blockfrost-api 0.1.0.0 → 0.2.0.0
raw patch · 30 files changed
+716/−93 lines, 30 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Blockfrost.Auth: Alonzo :: Env
- Blockfrost.Env: Alonzo :: Env
- Blockfrost.Lens: cBORMetadata :: HasCBORMetadata s a => Lens' s a
- Blockfrost.Lens: class HasCBORMetadata s a | s -> a
- Blockfrost.Lens: instance Blockfrost.Lens.HasAmount Blockfrost.Types.Cardano.Addresses.AddressUTXO [Blockfrost.Types.Shared.Amount.Amount]
- Blockfrost.Lens: instance Blockfrost.Lens.HasBlock Blockfrost.Types.Cardano.Addresses.AddressUTXO Blockfrost.Types.Shared.BlockHash.BlockHash
- Blockfrost.Lens: instance Blockfrost.Lens.HasCBORMetadata Blockfrost.Types.Cardano.Metadata.TxMetaCBOR (GHC.Maybe.Maybe Data.Text.Internal.Text)
- Blockfrost.Lens: instance Blockfrost.Lens.HasCBORMetadata Blockfrost.Types.Cardano.Transactions.TransactionMetaCBOR (GHC.Maybe.Maybe Data.Text.Internal.Text)
- Blockfrost.Lens: instance Blockfrost.Lens.HasOutputIndex Blockfrost.Types.Cardano.Addresses.AddressUTXO GHC.Integer.Type.Integer
- Blockfrost.Lens: instance Blockfrost.Lens.HasTxHash Blockfrost.Types.Cardano.Addresses.AddressUTXO Blockfrost.Types.Shared.TxHash.TxHash
- Blockfrost.Types.Cardano.Addresses: AddressUTXO :: TxHash -> Integer -> [Amount] -> BlockHash -> AddressUTXO
- Blockfrost.Types.Cardano.Addresses: [_addressUTXOAmount] :: AddressUTXO -> [Amount]
- Blockfrost.Types.Cardano.Addresses: [_addressUTXOBlock] :: AddressUTXO -> BlockHash
- Blockfrost.Types.Cardano.Addresses: [_addressUTXOOutputIndex] :: AddressUTXO -> Integer
- Blockfrost.Types.Cardano.Addresses: [_addressUTXOTxHash] :: AddressUTXO -> TxHash
- Blockfrost.Types.Cardano.Addresses: data AddressUTXO
- Blockfrost.Types.Cardano.Addresses: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Addresses.AddressUTXO
- Blockfrost.Types.Cardano.Addresses: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Addresses.AddressUTXO
- Blockfrost.Types.Cardano.Addresses: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Addresses.AddressUTXO
- Blockfrost.Types.Cardano.Addresses: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Addresses.AddressUTXO
- Blockfrost.Types.Cardano.Addresses: instance GHC.Show.Show Blockfrost.Types.Cardano.Addresses.AddressUTXO
- Blockfrost.Types.Cardano.Addresses: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Cardano.Addresses.AddressUTXO
- Blockfrost.Types.Cardano.Metadata: [_txMetaCBORCBORMetadata] :: TxMetaCBOR -> Maybe Text
- Blockfrost.Types.Cardano.Transactions: [_transactionMetaCBORCBORMetadata] :: TransactionMetaCBOR -> Maybe Text
+ Blockfrost.Lens: class HasCoinsPerUtxoWord s a | s -> a
+ Blockfrost.Lens: class HasCollateral s a | s -> a
+ Blockfrost.Lens: class HasCollateralPercent s a | s -> a
+ Blockfrost.Lens: class HasDataHash s a | s -> a
+ Blockfrost.Lens: class HasExtraEntropy s a | s -> a
+ Blockfrost.Lens: class HasLiveDelegators s a | s -> a
+ Blockfrost.Lens: class HasMaxBlockExMem s a | s -> a
+ Blockfrost.Lens: class HasMaxBlockExSteps s a | s -> a
+ Blockfrost.Lens: class HasMaxCollateralInputs s a | s -> a
+ Blockfrost.Lens: class HasMaxTxExMem s a | s -> a
+ Blockfrost.Lens: class HasMaxTxExSteps s a | s -> a
+ Blockfrost.Lens: class HasMaxValSize s a | s -> a
+ Blockfrost.Lens: class HasPriceMem s a | s -> a
+ Blockfrost.Lens: class HasPriceStep s a | s -> a
+ Blockfrost.Lens: class HasRedeemerCount s a | s -> a
+ Blockfrost.Lens: class HasScript s a | s -> a
+ Blockfrost.Lens: coinsPerUtxoWord :: HasCoinsPerUtxoWord s a => Lens' s a
+ Blockfrost.Lens: collateral :: HasCollateral s a => Lens' s a
+ Blockfrost.Lens: collateralPercent :: HasCollateralPercent s a => Lens' s a
+ Blockfrost.Lens: dataHash :: HasDataHash s a => Lens' s a
+ Blockfrost.Lens: extraEntropy :: HasExtraEntropy s a => Lens' s a
+ Blockfrost.Lens: instance (a GHC.Types.~ Blockfrost.Types.Shared.Ada.Lovelaces) => Blockfrost.Lens.HasCoinsPerUtxoWord Blockfrost.Types.Cardano.Epochs.ProtocolParams a
+ Blockfrost.Lens: instance Blockfrost.Lens.HasAmount Blockfrost.Types.Cardano.Addresses.AddressUtxo [Blockfrost.Types.Shared.Amount.Amount]
+ Blockfrost.Lens: instance Blockfrost.Lens.HasBlock Blockfrost.Types.Cardano.Addresses.AddressUtxo Blockfrost.Types.Shared.BlockHash.BlockHash
+ Blockfrost.Lens: instance Blockfrost.Lens.HasCollateral Blockfrost.Types.Cardano.Transactions.UtxoInput GHC.Types.Bool
+ Blockfrost.Lens: instance Blockfrost.Lens.HasCollateralPercent Blockfrost.Types.Cardano.Epochs.ProtocolParams GHC.Integer.Type.Integer
+ Blockfrost.Lens: instance Blockfrost.Lens.HasDataHash Blockfrost.Types.Cardano.Addresses.AddressUtxo (GHC.Maybe.Maybe Data.Text.Internal.Text)
+ Blockfrost.Lens: instance Blockfrost.Lens.HasDataHash Blockfrost.Types.Cardano.Transactions.UtxoInput (GHC.Maybe.Maybe Data.Text.Internal.Text)
+ Blockfrost.Lens: instance Blockfrost.Lens.HasDataHash Blockfrost.Types.Cardano.Transactions.UtxoOutput (GHC.Maybe.Maybe Data.Text.Internal.Text)
+ Blockfrost.Lens: instance Blockfrost.Lens.HasExtraEntropy Blockfrost.Types.Cardano.Epochs.ProtocolParams (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Value)
+ Blockfrost.Lens: instance Blockfrost.Lens.HasLiveDelegators Blockfrost.Types.Cardano.Pools.PoolInfo GHC.Types.Double
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMaxBlockExMem Blockfrost.Types.Cardano.Epochs.ProtocolParams Blockfrost.Types.Shared.Quantity.Quantity
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMaxBlockExSteps Blockfrost.Types.Cardano.Epochs.ProtocolParams Blockfrost.Types.Shared.Quantity.Quantity
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMaxCollateralInputs Blockfrost.Types.Cardano.Epochs.ProtocolParams GHC.Integer.Type.Integer
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMaxTxExMem Blockfrost.Types.Cardano.Epochs.ProtocolParams Blockfrost.Types.Shared.Quantity.Quantity
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMaxTxExSteps Blockfrost.Types.Cardano.Epochs.ProtocolParams Blockfrost.Types.Shared.Quantity.Quantity
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMaxValSize Blockfrost.Types.Cardano.Epochs.ProtocolParams Blockfrost.Types.Shared.Quantity.Quantity
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMetadata Blockfrost.Types.Cardano.Metadata.TxMetaCBOR (GHC.Maybe.Maybe Data.Text.Internal.Text)
+ Blockfrost.Lens: instance Blockfrost.Lens.HasMetadata Blockfrost.Types.Cardano.Transactions.TransactionMetaCBOR (GHC.Maybe.Maybe Data.Text.Internal.Text)
+ Blockfrost.Lens: instance Blockfrost.Lens.HasOutputIndex Blockfrost.Types.Cardano.Addresses.AddressUtxo GHC.Integer.Type.Integer
+ Blockfrost.Lens: instance Blockfrost.Lens.HasOutputIndex Blockfrost.Types.Cardano.Transactions.UtxoOutput GHC.Integer.Type.Integer
+ Blockfrost.Lens: instance Blockfrost.Lens.HasPriceMem Blockfrost.Types.Cardano.Epochs.ProtocolParams GHC.Types.Double
+ Blockfrost.Lens: instance Blockfrost.Lens.HasPriceStep Blockfrost.Types.Cardano.Epochs.ProtocolParams GHC.Types.Double
+ Blockfrost.Lens: instance Blockfrost.Lens.HasRedeemerCount Blockfrost.Types.Cardano.Transactions.Transaction GHC.Integer.Type.Integer
+ Blockfrost.Lens: instance Blockfrost.Lens.HasScript Blockfrost.Types.Cardano.Addresses.AddressInfo GHC.Types.Bool
+ Blockfrost.Lens: instance Blockfrost.Lens.HasTxHash Blockfrost.Types.Cardano.Addresses.AddressUtxo Blockfrost.Types.Shared.TxHash.TxHash
+ Blockfrost.Lens: liveDelegators :: HasLiveDelegators s a => Lens' s a
+ Blockfrost.Lens: maxBlockExMem :: HasMaxBlockExMem s a => Lens' s a
+ Blockfrost.Lens: maxBlockExSteps :: HasMaxBlockExSteps s a => Lens' s a
+ Blockfrost.Lens: maxCollateralInputs :: HasMaxCollateralInputs s a => Lens' s a
+ Blockfrost.Lens: maxTxExMem :: HasMaxTxExMem s a => Lens' s a
+ Blockfrost.Lens: maxTxExSteps :: HasMaxTxExSteps s a => Lens' s a
+ Blockfrost.Lens: maxValSize :: HasMaxValSize s a => Lens' s a
+ Blockfrost.Lens: priceMem :: HasPriceMem s a => Lens' s a
+ Blockfrost.Lens: priceStep :: HasPriceStep s a => Lens' s a
+ Blockfrost.Lens: redeemerCount :: HasRedeemerCount s a => Lens' s a
+ Blockfrost.Lens: script :: HasScript s a => Lens' s a
+ Blockfrost.Types.Cardano.Addresses: AddressUtxo :: TxHash -> Integer -> [Amount] -> BlockHash -> Maybe Text -> AddressUtxo
+ Blockfrost.Types.Cardano.Addresses: [_addressInfoScript] :: AddressInfo -> Bool
+ Blockfrost.Types.Cardano.Addresses: [_addressUtxoAmount] :: AddressUtxo -> [Amount]
+ Blockfrost.Types.Cardano.Addresses: [_addressUtxoBlock] :: AddressUtxo -> BlockHash
+ Blockfrost.Types.Cardano.Addresses: [_addressUtxoDataHash] :: AddressUtxo -> Maybe Text
+ Blockfrost.Types.Cardano.Addresses: [_addressUtxoOutputIndex] :: AddressUtxo -> Integer
+ Blockfrost.Types.Cardano.Addresses: [_addressUtxoTxHash] :: AddressUtxo -> TxHash
+ Blockfrost.Types.Cardano.Addresses: data AddressUtxo
+ Blockfrost.Types.Cardano.Addresses: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Addresses.AddressUtxo
+ Blockfrost.Types.Cardano.Addresses: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Addresses.AddressUtxo
+ Blockfrost.Types.Cardano.Addresses: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Addresses.AddressUtxo
+ Blockfrost.Types.Cardano.Addresses: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Addresses.AddressUtxo
+ Blockfrost.Types.Cardano.Addresses: instance GHC.Show.Show Blockfrost.Types.Cardano.Addresses.AddressUtxo
+ Blockfrost.Types.Cardano.Addresses: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Cardano.Addresses.AddressUtxo
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsCoinsPerUtxoWord] :: ProtocolParams -> Lovelaces
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsCollateralPercent] :: ProtocolParams -> Integer
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsExtraEntropy] :: ProtocolParams -> Maybe Value
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsMaxBlockExMem] :: ProtocolParams -> Quantity
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsMaxBlockExSteps] :: ProtocolParams -> Quantity
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsMaxCollateralInputs] :: ProtocolParams -> Integer
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsMaxTxExMem] :: ProtocolParams -> Quantity
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsMaxTxExSteps] :: ProtocolParams -> Quantity
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsMaxValSize] :: ProtocolParams -> Quantity
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsPriceMem] :: ProtocolParams -> Double
+ Blockfrost.Types.Cardano.Epochs: [_protocolParamsPriceStep] :: ProtocolParams -> Double
+ Blockfrost.Types.Cardano.Metadata: [_txMetaCBORMetadata] :: TxMetaCBOR -> Maybe Text
+ Blockfrost.Types.Cardano.Network: [_supplyLocked] :: NetworkSupply -> Lovelaces
+ Blockfrost.Types.Cardano.Network: [_supplyReserves] :: NetworkSupply -> Lovelaces
+ Blockfrost.Types.Cardano.Network: [_supplyTreasury] :: NetworkSupply -> Lovelaces
+ Blockfrost.Types.Cardano.Pools: [_poolInfoLiveDelegators] :: PoolInfo -> Double
+ Blockfrost.Types.Cardano.Scripts: Plutus :: ScriptType
+ Blockfrost.Types.Cardano.Scripts: Script :: ScriptHash -> ScriptType -> Maybe Integer -> Script
+ Blockfrost.Types.Cardano.Scripts: ScriptCBOR :: Maybe Text -> ScriptCBOR
+ Blockfrost.Types.Cardano.Scripts: ScriptDatum :: Value -> ScriptDatum
+ Blockfrost.Types.Cardano.Scripts: ScriptJSON :: Maybe Value -> ScriptJSON
+ Blockfrost.Types.Cardano.Scripts: ScriptRedeemer :: TxHash -> Integer -> ValidationPurpose -> Text -> Quantity -> Quantity -> Lovelaces -> ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: Timelock :: ScriptType
+ Blockfrost.Types.Cardano.Scripts: [_scriptCborCbor] :: ScriptCBOR -> Maybe Text
+ Blockfrost.Types.Cardano.Scripts: [_scriptDatumJsonValue] :: ScriptDatum -> Value
+ Blockfrost.Types.Cardano.Scripts: [_scriptJsonJson] :: ScriptJSON -> Maybe Value
+ Blockfrost.Types.Cardano.Scripts: [_scriptRedeemerDatumHash] :: ScriptRedeemer -> Text
+ Blockfrost.Types.Cardano.Scripts: [_scriptRedeemerFee] :: ScriptRedeemer -> Lovelaces
+ Blockfrost.Types.Cardano.Scripts: [_scriptRedeemerPurpose] :: ScriptRedeemer -> ValidationPurpose
+ Blockfrost.Types.Cardano.Scripts: [_scriptRedeemerTxHash] :: ScriptRedeemer -> TxHash
+ Blockfrost.Types.Cardano.Scripts: [_scriptRedeemerTxIndex] :: ScriptRedeemer -> Integer
+ Blockfrost.Types.Cardano.Scripts: [_scriptRedeemerUnitMem] :: ScriptRedeemer -> Quantity
+ Blockfrost.Types.Cardano.Scripts: [_scriptRedeemerUnitSteps] :: ScriptRedeemer -> Quantity
+ Blockfrost.Types.Cardano.Scripts: [_scriptScriptHash] :: Script -> ScriptHash
+ Blockfrost.Types.Cardano.Scripts: [_scriptSerialisedSize] :: Script -> Maybe Integer
+ Blockfrost.Types.Cardano.Scripts: [_scriptType] :: Script -> ScriptType
+ Blockfrost.Types.Cardano.Scripts: data Script
+ Blockfrost.Types.Cardano.Scripts: data ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: data ScriptType
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Scripts.Script
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Scripts.ScriptCBOR
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Scripts.ScriptDatum
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Scripts.ScriptJSON
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Scripts.ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Scripts.ScriptType
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Scripts.Script
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Scripts.ScriptCBOR
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Scripts.ScriptDatum
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Scripts.ScriptJSON
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Scripts.ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Scripts.ScriptType
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Scripts.Script
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Scripts.ScriptCBOR
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Scripts.ScriptDatum
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Scripts.ScriptJSON
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Scripts.ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Scripts.ScriptType
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Scripts.Script
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Scripts.ScriptCBOR
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Scripts.ScriptDatum
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Scripts.ScriptJSON
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Scripts.ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Scripts.ScriptType
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Show.Show Blockfrost.Types.Cardano.Scripts.Script
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Show.Show Blockfrost.Types.Cardano.Scripts.ScriptCBOR
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Show.Show Blockfrost.Types.Cardano.Scripts.ScriptDatum
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Show.Show Blockfrost.Types.Cardano.Scripts.ScriptJSON
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Show.Show Blockfrost.Types.Cardano.Scripts.ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: instance GHC.Show.Show Blockfrost.Types.Cardano.Scripts.ScriptType
+ Blockfrost.Types.Cardano.Scripts: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Cardano.Scripts.Script
+ Blockfrost.Types.Cardano.Scripts: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Cardano.Scripts.ScriptRedeemer
+ Blockfrost.Types.Cardano.Scripts: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Cardano.Scripts.ScriptType
+ Blockfrost.Types.Cardano.Scripts: newtype ScriptCBOR
+ Blockfrost.Types.Cardano.Scripts: newtype ScriptDatum
+ Blockfrost.Types.Cardano.Scripts: newtype ScriptJSON
+ Blockfrost.Types.Cardano.Transactions: Cert :: ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: Mint :: ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: Reward :: ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: Spend :: ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: TransactionRedeemer :: Integer -> ValidationPurpose -> Text -> Text -> Quantity -> Quantity -> Lovelaces -> TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: [_transactionMetaCBORMetadata] :: TransactionMetaCBOR -> Maybe Text
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerCount] :: Transaction -> Integer
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerDatumHash] :: TransactionRedeemer -> Text
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerFee] :: TransactionRedeemer -> Lovelaces
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerPurpose] :: TransactionRedeemer -> ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerScriptHash] :: TransactionRedeemer -> Text
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerTxIndex] :: TransactionRedeemer -> Integer
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerUnitMem] :: TransactionRedeemer -> Quantity
+ Blockfrost.Types.Cardano.Transactions: [_transactionRedeemerUnitSteps] :: TransactionRedeemer -> Quantity
+ Blockfrost.Types.Cardano.Transactions: [_utxoInputCollateral] :: UtxoInput -> Bool
+ Blockfrost.Types.Cardano.Transactions: [_utxoInputDataHash] :: UtxoInput -> Maybe Text
+ Blockfrost.Types.Cardano.Transactions: [_utxoOutputDataHash] :: UtxoOutput -> Maybe Text
+ Blockfrost.Types.Cardano.Transactions: [_utxoOutputOutputIndex] :: UtxoOutput -> Integer
+ Blockfrost.Types.Cardano.Transactions: data TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: data ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Transactions.TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Cardano.Transactions.ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Transactions.TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Cardano.Transactions.ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Transactions.TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: instance GHC.Classes.Eq Blockfrost.Types.Cardano.Transactions.ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Transactions.TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: instance GHC.Generics.Generic Blockfrost.Types.Cardano.Transactions.ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: instance GHC.Show.Show Blockfrost.Types.Cardano.Transactions.TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: instance GHC.Show.Show Blockfrost.Types.Cardano.Transactions.ValidationPurpose
+ Blockfrost.Types.Cardano.Transactions: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Cardano.Transactions.TransactionRedeemer
+ Blockfrost.Types.Cardano.Transactions: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Cardano.Transactions.ValidationPurpose
+ Blockfrost.Types.Shared.DatumHash: DatumHash :: Text -> DatumHash
+ Blockfrost.Types.Shared.DatumHash: [unDatumHash] :: DatumHash -> Text
+ Blockfrost.Types.Shared.DatumHash: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance Data.String.IsString Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance GHC.Classes.Eq Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance GHC.Generics.Generic Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance GHC.Show.Show Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance Servant.Docs.Internal.ToCapture (Servant.API.Capture.Capture "script_hash" Blockfrost.Types.Shared.DatumHash.DatumHash)
+ Blockfrost.Types.Shared.DatumHash: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance Web.Internal.HttpApiData.FromHttpApiData Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: instance Web.Internal.HttpApiData.ToHttpApiData Blockfrost.Types.Shared.DatumHash.DatumHash
+ Blockfrost.Types.Shared.DatumHash: newtype DatumHash
+ Blockfrost.Types.Shared.ScriptHash: ScriptHash :: Text -> ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: [unScriptHash] :: ScriptHash -> Text
+ Blockfrost.Types.Shared.ScriptHash: instance Data.Aeson.Types.FromJSON.FromJSON Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance Data.Aeson.Types.FromJSON.FromJSON [Blockfrost.Types.Shared.ScriptHash.ScriptHash]
+ Blockfrost.Types.Shared.ScriptHash: instance Data.Aeson.Types.ToJSON.ToJSON Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance Data.Aeson.Types.ToJSON.ToJSON [Blockfrost.Types.Shared.ScriptHash.ScriptHash]
+ Blockfrost.Types.Shared.ScriptHash: instance Data.String.IsString Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance GHC.Classes.Eq Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance GHC.Generics.Generic Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance GHC.Show.Show Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance Servant.Docs.Internal.ToCapture (Servant.API.Capture.Capture "script_hash" Blockfrost.Types.Shared.ScriptHash.ScriptHash)
+ Blockfrost.Types.Shared.ScriptHash: instance Servant.Docs.Internal.ToSample Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance Web.Internal.HttpApiData.FromHttpApiData Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: instance Web.Internal.HttpApiData.ToHttpApiData Blockfrost.Types.Shared.ScriptHash.ScriptHash
+ Blockfrost.Types.Shared.ScriptHash: newtype ScriptHash
+ Paths_blockfrost_api: getBinDir :: IO FilePath
+ Paths_blockfrost_api: getDataDir :: IO FilePath
+ Paths_blockfrost_api: getDataFileName :: FilePath -> IO FilePath
+ Paths_blockfrost_api: getDynLibDir :: IO FilePath
+ Paths_blockfrost_api: getLibDir :: IO FilePath
+ Paths_blockfrost_api: getLibexecDir :: IO FilePath
+ Paths_blockfrost_api: getSysconfDir :: IO FilePath
+ Paths_blockfrost_api: version :: Version
- Blockfrost.Types.Cardano.Addresses: AddressInfo :: Address -> [Amount] -> Maybe Address -> AddressType -> AddressInfo
+ Blockfrost.Types.Cardano.Addresses: AddressInfo :: Address -> [Amount] -> Maybe Address -> AddressType -> Bool -> AddressInfo
- Blockfrost.Types.Cardano.Epochs: ProtocolParams :: Epoch -> Integer -> Integer -> Integer -> Integer -> Integer -> Lovelaces -> Lovelaces -> Integer -> Integer -> Double -> Double -> Double -> Double -> Integer -> Integer -> Lovelaces -> Lovelaces -> Text -> ProtocolParams
+ Blockfrost.Types.Cardano.Epochs: ProtocolParams :: Epoch -> Integer -> Integer -> Integer -> Integer -> Integer -> Lovelaces -> Lovelaces -> Integer -> Integer -> Double -> Double -> Double -> Double -> Maybe Value -> Integer -> Integer -> Lovelaces -> Lovelaces -> Text -> Double -> Double -> Quantity -> Quantity -> Quantity -> Quantity -> Quantity -> Integer -> Integer -> Lovelaces -> ProtocolParams
- Blockfrost.Types.Cardano.Network: NetworkSupply :: Lovelaces -> Lovelaces -> Lovelaces -> NetworkSupply
+ Blockfrost.Types.Cardano.Network: NetworkSupply :: Lovelaces -> Lovelaces -> Lovelaces -> Lovelaces -> Lovelaces -> Lovelaces -> NetworkSupply
- Blockfrost.Types.Cardano.Pools: PoolInfo :: PoolId -> Text -> Text -> Integer -> Lovelaces -> Double -> Double -> Lovelaces -> Double -> Lovelaces -> Lovelaces -> Double -> Lovelaces -> Address -> [Address] -> [Text] -> [Text] -> PoolInfo
+ Blockfrost.Types.Cardano.Pools: PoolInfo :: PoolId -> Text -> Text -> Integer -> Lovelaces -> Double -> Double -> Double -> Lovelaces -> Double -> Lovelaces -> Lovelaces -> Double -> Lovelaces -> Address -> [Address] -> [Text] -> [Text] -> PoolInfo
- Blockfrost.Types.Cardano.Transactions: Transaction :: Text -> BlockHash -> Integer -> Slot -> Integer -> [Amount] -> Lovelaces -> Lovelaces -> Integer -> Maybe Text -> Maybe Text -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Transaction
+ Blockfrost.Types.Cardano.Transactions: Transaction :: Text -> BlockHash -> Integer -> Slot -> Integer -> [Amount] -> Lovelaces -> Lovelaces -> Integer -> Maybe Text -> Maybe Text -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Transaction
- Blockfrost.Types.Cardano.Transactions: UtxoInput :: Address -> [Amount] -> Text -> Integer -> UtxoInput
+ Blockfrost.Types.Cardano.Transactions: UtxoInput :: Address -> [Amount] -> Text -> Integer -> Bool -> Maybe Text -> UtxoInput
- Blockfrost.Types.Cardano.Transactions: UtxoOutput :: Address -> [Amount] -> UtxoOutput
+ Blockfrost.Types.Cardano.Transactions: UtxoOutput :: Address -> [Amount] -> Maybe Text -> Integer -> UtxoOutput
Files
- CHANGELOG.md +33/−1
- blockfrost-api.cabal +11/−2
- src/Blockfrost/API.hs +7/−0
- src/Blockfrost/API/Cardano.hs +2/−0
- src/Blockfrost/API/Cardano/Addresses.hs +11/−1
- src/Blockfrost/API/Cardano/Epochs.hs +1/−1
- src/Blockfrost/API/Cardano/Scripts.hs +62/−0
- src/Blockfrost/API/Cardano/Transactions.hs +7/−0
- src/Blockfrost/Env.hs +2/−3
- src/Blockfrost/Lens.hs +1/−1
- src/Blockfrost/Types/Cardano.hs +2/−0
- src/Blockfrost/Types/Cardano/Addresses.hs +30/−23
- src/Blockfrost/Types/Cardano/Epochs.hs +25/−3
- src/Blockfrost/Types/Cardano/Metadata.hs +3/−3
- src/Blockfrost/Types/Cardano/Network.hs +14/−6
- src/Blockfrost/Types/Cardano/Pools.hs +2/−0
- src/Blockfrost/Types/Cardano/Scripts.hs +86/−0
- src/Blockfrost/Types/Cardano/Transactions.hs +53/−7
- src/Blockfrost/Types/Shared.hs +4/−0
- src/Blockfrost/Types/Shared/DatumHash.hs +36/−0
- src/Blockfrost/Types/Shared/ScriptHash.hs +47/−0
- src/Blockfrost/Util/UserAgent.hs +19/−0
- test/Cardano/Accounts.hs +5/−0
- test/Cardano/Addresses.hs +31/−23
- test/Cardano/Epochs.hs +22/−2
- test/Cardano/Metadata.hs +3/−4
- test/Cardano/Network.hs +16/−8
- test/Cardano/Pools.hs +1/−0
- test/Cardano/Scripts.hs +137/−0
- test/Cardano/Transactions.hs +43/−5
CHANGELOG.md view
@@ -1,4 +1,36 @@-# Version [0.1.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/initial...0.1.0.0) (2021-09-14)+# Version [0.2.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/v0.1.0.0...v0.2.0.0) (2021-10-29)++* Breaking changes+ * `AddressUTXO` renamed to `AddressUtxo` along with its fields+ * `ProtocolParams` `collateralPercent` field type changed from `Double` to `Integer`+ * `TransactionMetaCBOR` now uses `metadata` field instead of `CBORMetadata` which holds the same CBOR value as before but without `\\x` prefix++* Alonzo additions+ * `collateral` field to `UtxoInput`+ * `redeemerCount` field to `Transaction`+ * `dataHash` field to `UtxoInput` and `UtxoOutput`+ * `dataHash` field to `AdressUTXO`+ * `outputIndex` field to `UtxoOutput`+ * `script` field to `AddressInfo`+ * `datumHash` field to `ScriptRedeemer`+ * `scriptHash` and `datumHash` field to `TransactionRedeemer`+ * `NetworkSupply`+ * `locked` field representing supply locked by all scripts+ * `treasury` field (current treasury supply)+ * `reserves` field (current reserves supply)+ * `/txs/${hash}/redeemers` endpoint with `TransactionRedeemer` and `ValidationPurpose` types+ * Epoch cost model parameters to `ProtocolParams`+ * `/scripts` endpoint and `ScriptHash` newtype+ * `/scripts/${script_hash}` endpoint with `Script` data type+ * `/scripts/${script_hash}/redeemers` endpoint with `ScriptRedeemer` data type+ * `/scripts/datum/${datum_hash}` endpoint with `ScriptDatum` data type+ * `/scripts/${script_hash}/json` endpoint with `ScriptJSON` data type+ * `/scripts/${script_hash}/cbor` endpoint with `ScriptCBOR` data type++* Other+ * Added `liveDelegators` field to `PoolInfo`++# Version [0.1.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/initial...v0.1.0.0) (2021-09-14) * Initial release
blockfrost-api.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: blockfrost-api-version: 0.1.0.0+version: 0.2.0.0 synopsis: API definitions for blockfrost.io description: Core types and Servant API description homepage: https://github.com/blockfrost/blockfrost-haskell@@ -9,7 +9,7 @@ author: blockfrost.io maintainer: srk@48.io copyright: 2021 blockfrost.io-category: Web+category: Cardano build-type: Simple extra-source-files:@@ -70,6 +70,7 @@ , Blockfrost.API.Cardano.Metadata , Blockfrost.API.Cardano.Network , Blockfrost.API.Cardano.Pools+ , Blockfrost.API.Cardano.Scripts , Blockfrost.API.Cardano.Transactions , Blockfrost.API.IPFS , Blockfrost.API.NutLink@@ -89,6 +90,7 @@ , Blockfrost.Types.Cardano.Metadata , Blockfrost.Types.Cardano.Network , Blockfrost.Types.Cardano.Pools+ , Blockfrost.Types.Cardano.Scripts , Blockfrost.Types.Cardano.Transactions , Blockfrost.Types.IPFS , Blockfrost.Types.NutLink@@ -99,8 +101,10 @@ , Blockfrost.Types.Shared.BlockIndex , Blockfrost.Types.Shared.Epoch , Blockfrost.Types.Shared.CBOR+ , Blockfrost.Types.Shared.DatumHash , Blockfrost.Types.Shared.Opts , Blockfrost.Types.Shared.POSIXMillis+ , Blockfrost.Types.Shared.ScriptHash , Blockfrost.Types.Shared.Slot , Blockfrost.Types.Shared.TxHash , Blockfrost.Types.Shared.Amount@@ -112,6 +116,9 @@ , Blockfrost.Util.Pagination , Blockfrost.Util.Sorting , Blockfrost.Util.Tag+ , Blockfrost.Util.UserAgent+ , Paths_blockfrost_api+ autogen-modules: Paths_blockfrost_api build-depends: base >= 4.7 && < 5 , bytestring , data-default-class@@ -127,6 +134,7 @@ , safe-money , quickcheck-instances , QuickCheck+ , vector test-suite blockfrost-api-tests type: exitcode-stdio-1.0@@ -142,6 +150,7 @@ , Cardano.Metadata , Cardano.Network , Cardano.Pools+ , Cardano.Scripts , Cardano.Transactions , IPFS , NutLink
src/Blockfrost/API.hs view
@@ -29,6 +29,7 @@ import Blockfrost.Auth import Blockfrost.Types import Blockfrost.Util.Tag (Tag)+import Blockfrost.Util.UserAgent (UserAgent) -- * API @@ -47,6 +48,7 @@ :- "api" :> "v0" :> BlockfrostAuth+ :> UserAgent :> ToServantApi BlockfrostV0API } deriving (Generic) @@ -111,6 +113,11 @@ :- "pools" :> Tag "Cardano » Pools" :> ToServantApi PoolsAPI+ , _scripts+ :: route+ :- "scripts"+ :> Tag "Cardano » Scripts"+ :> ToServantApi ScriptsAPI , _transactions :: route :- "txs"
src/Blockfrost/API/Cardano.hs view
@@ -12,6 +12,7 @@ , module Blockfrost.API.Cardano.Metadata , module Blockfrost.API.Cardano.Network , module Blockfrost.API.Cardano.Pools+ , module Blockfrost.API.Cardano.Scripts , module Blockfrost.API.Cardano.Transactions ) where @@ -24,4 +25,5 @@ import Blockfrost.API.Cardano.Metadata import Blockfrost.API.Cardano.Network import Blockfrost.API.Cardano.Pools+import Blockfrost.API.Cardano.Scripts import Blockfrost.API.Cardano.Transactions
src/Blockfrost/API/Cardano/Addresses.hs view
@@ -37,7 +37,17 @@ :> "utxos" :> Pagination :> Sorting- :> Get '[JSON] [AddressUTXO]+ :> Get '[JSON] [AddressUtxo]+ , _addressUtxosAsset+ :: route+ :- Summary "Address UTXOs of a given asset"+ :> Description "UTXOs of the address."+ :> Capture "address" Address+ :> "utxos"+ :> Capture "asset" AssetId+ :> Pagination+ :> Sorting+ :> Get '[JSON] [AddressUtxo] , _addressTransactions :: route :- Summary "Address transactions"
src/Blockfrost/API/Cardano/Epochs.hs view
@@ -79,7 +79,7 @@ :> Get '[JSON] [BlockHash] , _getEpochBlocksByPool :: route- :- Summary "Block distribution"+ :- Summary "Block distribution by pool" :> Description "Return the block minted for the epoch specified by stake pool." :> Capture "epoch_number" Epoch :> "blocks"
+ src/Blockfrost/API/Cardano/Scripts.hs view
@@ -0,0 +1,62 @@+-- | Cardano Scripts endpoints++{-# OPTIONS_HADDOCK hide #-}++module Blockfrost.API.Cardano.Scripts+ where++import Servant.API+import Servant.API.Generic++import Blockfrost.Types.Cardano.Scripts+import Blockfrost.Types.Shared+import Blockfrost.Util.Pagination+import Blockfrost.Util.Sorting++data ScriptsAPI route =+ ScriptsAPI+ {+ _listScripts+ :: route+ :- Summary "Scripts"+ :> Description "List of scripts."+ :> Pagination+ :> Sorting+ :> Get '[JSON] [ScriptHash]+ , _getScript+ :: route+ :- Summary "Specific scripts"+ :> Description "Information about a specific script."+ :> Capture "script_hash" ScriptHash+ :> Get '[JSON] Script+ , _getScriptRedeemers+ :: route+ :- Summary "Redeemers of a specific script"+ :> Description "List of redeemers of a specific script."+ :> Capture "script_hash" ScriptHash+ :> Pagination+ :> Sorting+ :> "redeemers"+ :> Get '[JSON] [ScriptRedeemer]+ , _getScriptDatum+ :: route+ :- Summary "Datum value"+ :> Description "Query JSON value of a datum by its hash"+ :> "datum"+ :> Capture "datum_hash" DatumHash+ :> Get '[JSON] ScriptDatum+ , _getScriptJSON+ :: route+ :- Summary "Script JSON"+ :> Description "JSON representation of a `timelock` script"+ :> Capture "script_hash" ScriptHash+ :> "json"+ :> Get '[JSON] ScriptJSON+ , _getScriptCBOR+ :: route+ :- Summary "Script CBOR"+ :> Description "CBOR representation of a `plutus` script"+ :> Capture "script_hash" ScriptHash+ :> "cbor"+ :> Get '[JSON] ScriptCBOR+ } deriving (Generic)
src/Blockfrost/API/Cardano/Transactions.hs view
@@ -27,6 +27,13 @@ :> Capture "hash" TxHash :> "utxos" :> Get '[JSON] TransactionUtxos+ , _txRedeemers+ :: route+ :- Summary "Transaction redeemers"+ :> Description "Obtain the transaction redeemers."+ :> Capture "hash" TxHash+ :> "redeemers"+ :> Get '[JSON] [TransactionRedeemer] , _txStakes :: route :- Summary "Transaction stake addresses certificates "
src/Blockfrost/Env.hs view
@@ -15,8 +15,7 @@ -- Corresponds to Network when creating a Blockfrost project. -- Each environment has separate token. data Env =- Alonzo- | Ipfs+ Ipfs | Mainnet | Testnet | Localhost@@ -29,4 +28,4 @@ Nothing -> Left $ "Unknown environment: `" <> tEnv <> "`"- <> " expecting one of `alonzo`, `ipfs`, `mainnet`, `testnet`, `localhost`"+ <> " expecting one of `ipfs`, `mainnet`, `testnet`, `localhost`"
src/Blockfrost/Lens.hs view
@@ -22,7 +22,7 @@ makeLensesWith blockfrostFieldRules ''AddressInfo makeFields ''AddressDetails-makeFields ''AddressUTXO+makeFields ''AddressUtxo makeFields ''AddressTransaction makeFields ''AssetInfo
src/Blockfrost/Types/Cardano.hs view
@@ -10,6 +10,7 @@ , module Blockfrost.Types.Cardano.Metadata , module Blockfrost.Types.Cardano.Network , module Blockfrost.Types.Cardano.Pools+ , module Blockfrost.Types.Cardano.Scripts , module Blockfrost.Types.Cardano.Transactions ) where @@ -22,4 +23,5 @@ import Blockfrost.Types.Cardano.Metadata import Blockfrost.Types.Cardano.Network import Blockfrost.Types.Cardano.Pools+import Blockfrost.Types.Cardano.Scripts import Blockfrost.Types.Cardano.Transactions
src/Blockfrost/Types/Cardano/Addresses.hs view
@@ -4,11 +4,12 @@ ( AddressInfo (..) , AddressType (..) , AddressDetails (..)- , AddressUTXO (..)+ , AddressUtxo (..) , AddressTransaction (..) ) where import Blockfrost.Types.Shared+import Data.Text (Text) import Deriving.Aeson import qualified Money import Servant.Docs (ToSample (..), samples, singleSample)@@ -19,6 +20,7 @@ , _addressInfoAmount :: [Amount] -- ^ Lovelaces or tokens stored on this address , _addressInfoStakeAddress :: Maybe Address -- ^ Stake address that controls the key , _addressInfoType :: AddressType -- ^ Address era+ , _addressInfoScript :: Bool -- ^ True if this is a script address } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON) via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressInfo", CamelToSnake]] AddressInfo@@ -37,6 +39,7 @@ ] , _addressInfoStakeAddress = pure "stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7" , _addressInfoType = Shelley+ , _addressInfoScript = False } -- | Type (era) of an address@@ -76,33 +79,36 @@ ] -- | UTxOs of the address-data AddressUTXO = AddressUTXO- { _addressUTXOTxHash :: TxHash -- ^ Transaction hash of the UTXO- , _addressUTXOOutputIndex :: Integer -- ^ UTXO index in the transaction- , _addressUTXOAmount :: [Amount] -- ^ Amounts of Lovelaces or tokens- , _addressUTXOBlock :: BlockHash -- ^ Block hash of the UTXO+data AddressUtxo = AddressUtxo+ { _addressUtxoTxHash :: TxHash -- ^ Transaction hash of the UTXO+ , _addressUtxoOutputIndex :: Integer -- ^ UTXO index in the transaction+ , _addressUtxoAmount :: [Amount] -- ^ Amounts of Lovelaces or tokens+ , _addressUtxoBlock :: BlockHash -- ^ Block hash of the UTXO+ , _addressUtxoDataHash :: Maybe Text -- ^ Block hash of the UTXO } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)- via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressUTXO", CamelToSnake]] AddressUTXO+ via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressUtxo", CamelToSnake]] AddressUtxo -instance ToSample AddressUTXO where+instance ToSample AddressUtxo where toSamples = pure $ samples- [ AddressUTXO- { _addressUTXOTxHash = "39a7a284c2a0948189dc45dec670211cd4d72f7b66c5726c08d9b3df11e44d58"- , _addressUTXOOutputIndex = 0- , _addressUTXOAmount = [ AdaAmount 42000000 ]- , _addressUTXOBlock = "7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6"+ [ AddressUtxo+ { _addressUtxoTxHash = "39a7a284c2a0948189dc45dec670211cd4d72f7b66c5726c08d9b3df11e44d58"+ , _addressUtxoOutputIndex = 0+ , _addressUtxoAmount = [ AdaAmount 42000000 ]+ , _addressUtxoBlock = "7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6"+ , _addressUtxoDataHash = Just "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710" }- , AddressUTXO- { _addressUTXOTxHash = "4c4e67bafa15e742c13c592b65c8f74c769cd7d9af04c848099672d1ba391b49"- , _addressUTXOOutputIndex = 0- , _addressUTXOAmount = [ AdaAmount 729235000 ]- , _addressUTXOBlock = "953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7"+ , AddressUtxo+ { _addressUtxoTxHash = "4c4e67bafa15e742c13c592b65c8f74c769cd7d9af04c848099672d1ba391b49"+ , _addressUtxoOutputIndex = 0+ , _addressUtxoAmount = [ AdaAmount 729235000 ]+ , _addressUtxoBlock = "953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7"+ , _addressUtxoDataHash = Nothing }- , AddressUTXO- { _addressUTXOTxHash = "768c63e27a1c816a83dc7b07e78af673b2400de8849ea7e7b734ae1333d100d2"- , _addressUTXOOutputIndex = 1- , _addressUTXOAmount =+ , AddressUtxo+ { _addressUtxoTxHash = "768c63e27a1c816a83dc7b07e78af673b2400de8849ea7e7b734ae1333d100d2"+ , _addressUtxoOutputIndex = 1+ , _addressUtxoAmount = [ AdaAmount 42000000 , AssetAmount $ Money.mkSomeDiscrete@@ -110,7 +116,8 @@ unitScale 12 ]- , _addressUTXOBlock = "5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7"+ , _addressUtxoBlock = "5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7"+ , _addressUtxoDataHash = Nothing } ]
src/Blockfrost/Types/Cardano/Epochs.hs view
@@ -8,6 +8,7 @@ ) where import Blockfrost.Types.Shared+import Data.Aeson (Value) import Data.Text (Text) import Deriving.Aeson import Servant.Docs (ToSample (..), singleSample)@@ -61,13 +62,24 @@ , _protocolParamsRho :: Double -- ^ Monetary expansion , _protocolParamsTau :: Double -- ^ Treasury expansion , _protocolParamsDecentralisationParam :: Double -- ^ Percentage of blocks produced by federated nodes--- ?? TODO: object Nullable--- , protocolParamsExtraEntropy :: Maybe Value+ , _protocolParamsExtraEntropy :: Maybe Value -- ^ Seed for extra entropy , _protocolParamsProtocolMajorVer :: Integer -- ^ Accepted protocol major version , _protocolParamsProtocolMinorVer :: Integer -- ^ Accepted protocol minor version , _protocolParamsMinUtxo :: Lovelaces -- ^ Minimum UTXO value , _protocolParamsMinPoolCost :: Lovelaces -- ^ Minimum stake cost forced on the pool , _protocolParamsNonce :: Text -- ^ Epoch number only used once+ -- cost models+ -- https://github.com/input-output-hk/cardano-db-sync/pull/758+ , _protocolParamsPriceMem :: Double -- ^ The per word cost of script memory usage+ , _protocolParamsPriceStep :: Double -- ^ The cost of script execution step usage+ , _protocolParamsMaxTxExMem :: Quantity -- ^ The maximum number of execution memory allowed to be used in a single transaction+ , _protocolParamsMaxTxExSteps :: Quantity -- ^ The maximum number of execution steps allowed to be used in a single transaction+ , _protocolParamsMaxBlockExMem :: Quantity -- ^ The maximum number of execution memory allowed to be used in a single block+ , _protocolParamsMaxBlockExSteps :: Quantity -- ^ The maximum number of execution steps allowed to be used in a single block+ , _protocolParamsMaxValSize :: Quantity -- ^ The maximum Val size+ , _protocolParamsCollateralPercent :: Integer -- ^ The percentage of the transactions fee which must be provided as collateral when including non-native scripts+ , _protocolParamsMaxCollateralInputs :: Integer -- ^ The maximum number of collateral inputs allowed in a transaction+ , _protocolParamsCoinsPerUtxoWord :: Lovelaces -- ^ The cost per UTxO word } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)@@ -90,12 +102,22 @@ , _protocolParamsRho = 0.003 , _protocolParamsTau = 0.2 , _protocolParamsDecentralisationParam = 0.5--- , _protocolParamsExtraEntropy = Nothing+ , _protocolParamsExtraEntropy = Nothing , _protocolParamsProtocolMajorVer = 2 , _protocolParamsProtocolMinorVer = 0 , _protocolParamsMinUtxo = 1000000 , _protocolParamsMinPoolCost = 340000000 , _protocolParamsNonce = "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81"+ , _protocolParamsPriceMem = 0.0577+ , _protocolParamsPriceStep = 0.0000721+ , _protocolParamsMaxTxExMem = 10000000+ , _protocolParamsMaxTxExSteps = 10000000000+ , _protocolParamsMaxBlockExMem = 50000000+ , _protocolParamsMaxBlockExSteps = 40000000000+ , _protocolParamsMaxValSize = 5000+ , _protocolParamsCollateralPercent = 150+ , _protocolParamsMaxCollateralInputs = 3+ , _protocolParamsCoinsPerUtxoWord = 34482 } -- | Active stake distribution for an epoch
src/Blockfrost/Types/Cardano/Metadata.hs view
@@ -62,8 +62,8 @@ -- | Transaction metadata content in CBOR data TxMetaCBOR = TxMetaCBOR- { _txMetaCBORTxHash :: Text -- ^ Transaction hash that contains the specific metadata- , _txMetaCBORCBORMetadata :: Maybe Text -- ^ Content of the CBOR metadata+ { _txMetaCBORTxHash :: Text -- ^ Transaction hash that contains the specific metadata+ , _txMetaCBORMetadata :: Maybe Text -- ^ Content of the CBOR metadata } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)@@ -79,5 +79,5 @@ Nothing , TxMetaCBOR "4237501da3cfdd53ade91e8911e764bd0699d88fd43b12f44a1f459b89bc91be"- (Just "\\xa100a16b436f6d62696e6174696f6e8601010101010c")+ (Just "a100a16b436f6d62696e6174696f6e8601010101010c") ]
src/Blockfrost/Types/Cardano/Network.hs view
@@ -18,6 +18,9 @@ { _supplyMax :: Lovelaces -- ^ Maximum supply in Lovelaces , _supplyTotal :: Lovelaces -- ^ Current total (max supply - reserves) supply in Lovelaces , _supplyCirculating :: Lovelaces -- ^ Current circulating (UTXOs + withdrawables) supply in Lovelaces+ , _supplyLocked :: Lovelaces -- ^ Current supply locked by scripts in Lovelaces+ , _supplyTreasury :: Lovelaces -- ^ Current supply locked in treasury+ , _supplyReserves :: Lovelaces -- ^ Current supply locked in reserves } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)@@ -26,9 +29,13 @@ netSupplySample :: NetworkSupply netSupplySample = NetworkSupply- 45_000_000_000_000_000- 32_890_715_183_299_160- 32_412_601_976_210_393+ { _supplyMax = 45_000_000_000_000_000+ , _supplyTotal = 32_890_715_183_299_160+ , _supplyCirculating = 32_412_601_976_210_393+ , _supplyLocked = 125_006_953_355+ , _supplyTreasury = 98_635_632_000_000+ , _supplyReserves = 46_635_632_000_000+ } instance ToSample NetworkSupply where toSamples = pure $ singleSample netSupplySample@@ -45,11 +52,12 @@ netStakeSample :: NetworkStake netStakeSample = NetworkStake- 23_204_950_463_991_654- 22_210_233_523_456_321+ { _stakeLive = 23_204_950_463_991_654+ , _stakeActive = 22_210_233_523_456_321+ } instance ToSample NetworkStake where- toSamples = pure $ singleSample $ netStakeSample+ toSamples = pure $ singleSample netStakeSample -- | Detailed network information data Network = Network
src/Blockfrost/Types/Cardano/Pools.hs view
@@ -44,6 +44,7 @@ , _poolInfoLiveStake :: Lovelaces , _poolInfoLiveSize :: Double , _poolInfoLiveSaturation :: Double+ , _poolInfoLiveDelegators :: Double , _poolInfoActiveStake :: Lovelaces , _poolInfoActiveSize :: Double , _poolInfoDeclaredPledge :: Lovelaces -- ^ Stake pool certificate pledge@@ -69,6 +70,7 @@ , _poolInfoLiveStake = 6900000000 , _poolInfoLiveSize = 0.42 , _poolInfoLiveSaturation = 0.93+ , _poolInfoLiveDelegators = 127 , _poolInfoActiveStake = 4200000000 , _poolInfoActiveSize = 0.43 , _poolInfoDeclaredPledge = 5000000000
+ src/Blockfrost/Types/Cardano/Scripts.hs view
@@ -0,0 +1,86 @@+-- | Cardano Scripts responses++module Blockfrost.Types.Cardano.Scripts+ ( Script (..)+ , ScriptType (..)+ , ScriptRedeemer (..)+ , ScriptDatum (..)+ , ScriptJSON (..)+ , ScriptCBOR (..)+ ) where++import Data.Aeson (Value)+import Data.Text (Text)+import Deriving.Aeson+import Servant.Docs (ToSample (..), samples, singleSample)++import Blockfrost.Types.Shared+import Blockfrost.Types.Cardano.Transactions (ValidationPurpose(Spend))++-- | Script type+data ScriptType = Plutus | Timelock+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[ConstructorTagModifier '[ToLower]] ScriptType++instance ToSample ScriptType where+ toSamples = pure $ samples [ Plutus, Timelock ]++-- | Script info+data Script = Script+ { _scriptScriptHash :: ScriptHash -- ^ Hash of the script+ , _scriptType :: ScriptType -- ^ Type of the script language+ , _scriptSerialisedSize :: Maybe Integer -- ^ The size of the CBOR serialised script, if a Plutus script+ }+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[FieldLabelModifier '[StripPrefix "_script", CamelToSnake]] Script++instance ToSample Script where+ toSamples = pure $ singleSample+ Script+ { _scriptScriptHash = "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656"+ , _scriptType = Plutus+ , _scriptSerialisedSize = Just 3119+ }++-- | Script redeemer+data ScriptRedeemer = ScriptRedeemer+ { _scriptRedeemerTxHash :: TxHash -- ^ Hash of the transaction+ , _scriptRedeemerTxIndex :: Integer -- ^ Index of the redeemer within a transaction+ , _scriptRedeemerPurpose :: ValidationPurpose -- ^ Validation purpose+ , _scriptRedeemerDatumHash :: Text -- ^ Datum hash+ , _scriptRedeemerUnitMem :: Quantity -- ^ The budget in Memory to run a script+ , _scriptRedeemerUnitSteps :: Quantity -- ^ The budget in Steps to run a script+ , _scriptRedeemerFee :: Lovelaces -- ^ The fee consumed to run the script+ }+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[FieldLabelModifier '[StripPrefix "_scriptRedeemer", CamelToSnake]] ScriptRedeemer++instance ToSample ScriptRedeemer where+ toSamples = pure $ singleSample+ ScriptRedeemer+ { _scriptRedeemerTxHash = "1a0570af966fb355a7160e4f82d5a80b8681b7955f5d44bec0dce628516157f0"+ , _scriptRedeemerTxIndex = 0+ , _scriptRedeemerPurpose = Spend+ , _scriptRedeemerDatumHash = "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"+ , _scriptRedeemerUnitMem = 1700+ , _scriptRedeemerUnitSteps = 476468+ , _scriptRedeemerFee = 172033+ }++newtype ScriptDatum = ScriptDatum { _scriptDatumJsonValue :: Value }+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[FieldLabelModifier '[StripPrefix "_scriptDatum", CamelToSnake]] ScriptDatum++newtype ScriptJSON = ScriptJSON { _scriptJsonJson :: Maybe Value }+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[FieldLabelModifier '[StripPrefix "_scriptJson", CamelToSnake]] ScriptJSON++newtype ScriptCBOR = ScriptCBOR { _scriptCborCbor :: Maybe Text }+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[FieldLabelModifier '[StripPrefix "_scriptCbor", CamelToSnake]] ScriptCBOR
src/Blockfrost/Types/Cardano/Transactions.hs view
@@ -5,6 +5,8 @@ , TransactionUtxos (..) , UtxoInput (..) , UtxoOutput (..)+ , ValidationPurpose (..)+ , TransactionRedeemer (..) , TransactionStake (..) , TransactionDelegation (..) , TransactionWithdrawal (..)@@ -37,7 +39,6 @@ , _transactionFees :: Lovelaces -- ^ Fees of the transaction in Lovelaces , _transactionDeposit :: Lovelaces -- ^ Deposit within the transaction in Lovelaces , _transactionSize :: Integer -- ^ Size of the transaction in Bytes- --_ TODO: Text Slots? , _transactionInvalidBefore :: Maybe Text -- ^ Left (included) endpoint of the timelock validity intervals , _transactionInvalidHereafter :: Maybe Text -- ^ Right (excluded) endpoint of the timelock validity intervals , _transactionUtxoCount :: Integer -- ^ Count of UTXOs within the transaction@@ -48,6 +49,7 @@ , _transactionPoolUpdateCount :: Integer -- ^ Count of the stake pool registration and update certificates within the transaction , _transactionPoolRetireCount :: Integer -- ^ Count of the stake pool retirement certificates within the transaction , _transactionAssetMintOrBurnCount :: Integer -- ^ Count of asset mints and burns within the transaction+ , _transactionRedeemerCount :: Integer -- ^ Count of redeemers within the transaction } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)@@ -75,6 +77,7 @@ , _transactionPoolUpdateCount = 0 , _transactionPoolRetireCount = 0 , _transactionAssetMintOrBurnCount = 0+ , _transactionRedeemerCount = 0 } -- | Transaction input UTxO@@ -83,6 +86,8 @@ , _utxoInputAmount :: [Amount] , _utxoInputTxHash :: Text -- ^ Hash of the UTXO transaction , _utxoInputOutputIndex :: Integer -- ^ UTXO index in the transaction+ , _utxoInputCollateral :: Bool -- ^ UTXO is a script collateral input+ , _utxoInputDataHash :: Maybe Text -- ^ The hash of the transaction output datum } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)@@ -98,12 +103,16 @@ , _utxoInputAmount = sampleAmounts , _utxoInputTxHash = "1a0570af966fb355a7160e4f82d5a80b8681b7955f5d44bec0dce628516157f0" , _utxoInputOutputIndex = 0+ , _utxoInputCollateral = False+ , _utxoInputDataHash = Just "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710" } -- | Transaction output UTxO data UtxoOutput = UtxoOutput- { _utxoOutputAddress :: Address -- ^ Output address- , _utxoOutputAmount :: [Amount]+ { _utxoOutputAddress :: Address -- ^ Output address+ , _utxoOutputAmount :: [Amount] -- ^ Transaction output amounts+ , _utxoOutputDataHash :: Maybe Text -- ^ The hash of the transaction output datum+ , _utxoOutputOutputIndex :: Integer -- ^ UTXO index in the transaction } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON) via CustomJSON '[FieldLabelModifier '[StripPrefix "_utxoOutput", CamelToSnake]] UtxoOutput@@ -116,13 +125,15 @@ UtxoOutput { _utxoOutputAddress = "addr1q9ld26v2lv8wvrxxmvg90pn8n8n5k6tdst06q2s856rwmvnueldzuuqmnsye359fqrk8hwvenjnqultn7djtrlft7jnq7dy7wv" , _utxoOutputAmount = sampleAmounts+ , _utxoOutputDataHash = Just "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710"+ , _utxoOutputOutputIndex = 0 } -- | Transaction UTxOs data TransactionUtxos = TransactionUtxos { _transactionUtxosHash :: TxHash -- ^ Transaction hash- , _transactionUtxosInputs :: [UtxoInput]- , _transactionUtxosOutputs :: [UtxoOutput]+ , _transactionUtxosInputs :: [UtxoInput] -- ^ Transaction inputs+ , _transactionUtxosOutputs :: [UtxoOutput] -- ^ Transaction outputs } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)@@ -146,6 +157,41 @@ 12 ] +-- | Validation purpose+data ValidationPurpose = Spend | Mint | Cert | Reward+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[ConstructorTagModifier '[ToLower]] ValidationPurpose++instance ToSample ValidationPurpose where+ toSamples = pure $ samples [ Spend, Mint, Cert, Reward ]++-- | Transaction redeemer+data TransactionRedeemer = TransactionRedeemer+ { _transactionRedeemerTxIndex :: Integer -- ^ Index of the redeemer within a transaction+ , _transactionRedeemerPurpose :: ValidationPurpose -- ^ Validation purpose+ , _transactionRedeemerScriptHash:: Text -- ^ Script hash+ , _transactionRedeemerDatumHash :: Text -- ^ Datum hash+ , _transactionRedeemerUnitMem :: Quantity -- ^ The budget in Memory to run a script+ , _transactionRedeemerUnitSteps :: Quantity -- ^ The budget in Steps to run a script+ , _transactionRedeemerFee :: Lovelaces -- ^ The fee consumed to run the script+ }+ deriving stock (Show, Eq, Generic)+ deriving (FromJSON, ToJSON)+ via CustomJSON '[FieldLabelModifier '[StripPrefix "_transactionRedeemer", CamelToSnake]] TransactionRedeemer++instance ToSample TransactionRedeemer where+ toSamples = pure $ singleSample+ TransactionRedeemer+ { _transactionRedeemerTxIndex = 0+ , _transactionRedeemerPurpose = Spend+ , _transactionRedeemerScriptHash = "ec26b89af41bef0f7585353831cb5da42b5b37185e0c8a526143b824"+ , _transactionRedeemerDatumHash = "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"+ , _transactionRedeemerUnitMem = 1700+ , _transactionRedeemerUnitSteps = 476468+ , _transactionRedeemerFee = 172033+ }+ -- | Information about (de-)registration of a stake address -- within a transaction data TransactionStake = TransactionStake@@ -317,7 +363,7 @@ -- | Transaction metadata in CBOR data TransactionMetaCBOR = TransactionMetaCBOR { _transactionMetaCBORLabel :: Text -- ^ Metadata label- , _transactionMetaCBORCBORMetadata :: Maybe Text -- ^ Content of the CBOR metadata+ , _transactionMetaCBORMetadata :: Maybe Text -- ^ Content of the CBOR metadata } deriving stock (Show, Eq, Generic) deriving (FromJSON, ToJSON)@@ -327,7 +373,7 @@ toSamples = pure $ singleSample $ TransactionMetaCBOR "1968"- (Just "\\xa100a16b436f6d62696e6174696f6e8601010101010c")+ (Just "a100a16b436f6d62696e6174696f6e8601010101010c") -- | Update of a pool metadata data PoolUpdateMetadata = PoolUpdateMetadata
@@ -8,6 +8,7 @@ , module Blockfrost.Types.Shared.BlockHash , module Blockfrost.Types.Shared.BlockIndex , module Blockfrost.Types.Shared.CBOR+ , module Blockfrost.Types.Shared.DatumHash , module Blockfrost.Types.Shared.Epoch , module Blockfrost.Types.Shared.Opts , module Blockfrost.Types.Shared.POSIXMillis@@ -15,6 +16,7 @@ , module Blockfrost.Types.Shared.PoolId , module Blockfrost.Types.Shared.Quantity , module Blockfrost.Types.Shared.Slot+ , module Blockfrost.Types.Shared.ScriptHash , module Blockfrost.Types.Shared.TxHash ) where @@ -25,6 +27,7 @@ import Blockfrost.Types.Shared.BlockHash import Blockfrost.Types.Shared.BlockIndex import Blockfrost.Types.Shared.CBOR+import Blockfrost.Types.Shared.DatumHash import Blockfrost.Types.Shared.Epoch import Blockfrost.Types.Shared.Opts import Blockfrost.Types.Shared.POSIXMillis@@ -32,4 +35,5 @@ import Blockfrost.Types.Shared.PoolId import Blockfrost.Types.Shared.Quantity import Blockfrost.Types.Shared.Slot+import Blockfrost.Types.Shared.ScriptHash import Blockfrost.Types.Shared.TxHash
@@ -0,0 +1,36 @@+-- | Datum Hash newtype++module Blockfrost.Types.Shared.DatumHash+ ( DatumHash (..)+ ) where++import Data.Aeson (FromJSON (..), ToJSON (..))+import Data.String (IsString (..))+import Data.Text (Text)+import qualified Data.Text+import GHC.Generics+import Servant.API (Capture, FromHttpApiData (..), ToHttpApiData (..))+import Servant.Docs (DocCapture (..), ToCapture (..), ToSample (..), samples)++-- | Hash of the datum+newtype DatumHash = DatumHash { unDatumHash :: Text }+ deriving stock (Show, Eq, Generic)+ deriving newtype (FromHttpApiData, ToHttpApiData)++instance IsString DatumHash where+ fromString = DatumHash . Data.Text.pack++instance ToJSON DatumHash where+ toJSON = toJSON . unDatumHash+ toEncoding = toEncoding . unDatumHash+instance FromJSON DatumHash where+ parseJSON = fmap DatumHash <$> parseJSON++instance ToSample DatumHash where+ toSamples _ = samples $ map DatumHash+ [ "5a595ce795815e81d22a1a522cf3987d546dc5bb016de61b002edd63a5413ec4"+ , "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"+ ]++instance ToCapture (Capture "script_hash" DatumHash) where+ toCapture _ = DocCapture "script_hash" "Hash of the script."
@@ -0,0 +1,47 @@+-- | Script Hash newtype++module Blockfrost.Types.Shared.ScriptHash+ ( ScriptHash (..)+ ) where++import Data.Aeson (FromJSON (..), ToJSON (..), Value(..), (.=), (.:))+import Data.String (IsString (..))+import Data.Text (Text)+import qualified Data.Text+import qualified Data.Vector+import GHC.Generics+import Servant.API (Capture, FromHttpApiData (..), ToHttpApiData (..))+import Servant.Docs (DocCapture (..), ToCapture (..), ToSample (..), samples)++-- | Script Hash newtype+newtype ScriptHash = ScriptHash { unScriptHash :: Text }+ deriving stock (Show, Eq, Generic)+ deriving newtype (FromHttpApiData, ToHttpApiData)++instance IsString ScriptHash where+ fromString = ScriptHash . Data.Text.pack++instance ToJSON ScriptHash where+ toJSON = toJSON . unScriptHash+ toEncoding = toEncoding . unScriptHash+instance FromJSON ScriptHash where+ parseJSON = fmap ScriptHash <$> parseJSON++-- Custom instance for list used by script list endpoint+instance {-# OVERLAPS #-} ToJSON [ScriptHash] where+ toJSON = Array . Data.Vector.fromList . map (\sh -> Object ("script_hash" .= (toJSON . unScriptHash $ sh)))+instance {-# OVERLAPS #-} FromJSON [ScriptHash] where+ parseJSON (Array a) = mapM parseJSON' (Data.Vector.toList a)+ where+ parseJSON' (Object b) = b .: "script_hash"+ parseJSON' _ = fail "Unexpected type for ScriptHash"+ parseJSON _ = fail "Expected array for [ScriptHash]"++instance ToSample ScriptHash where+ toSamples _ = samples $ map ScriptHash+ [ "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656"+ , "e1457a0c47dfb7a2f6b8fbb059bdceab163c05d34f195b87b9f2b30e"+ ]++instance ToCapture (Capture "script_hash" ScriptHash) where+ toCapture _ = DocCapture "script_hash" "Hash of the script."
+ src/Blockfrost/Util/UserAgent.hs view
@@ -0,0 +1,19 @@+{-# OPTIONS_HADDOCK hide #-}++module Blockfrost.Util.UserAgent (+ UserAgent+ , userAgent+ ) where++import Data.ByteString (ByteString)+import qualified Data.ByteString.Char8+import qualified Data.Version+import qualified Paths_blockfrost_api++data UserAgent++userAgent :: ByteString+userAgent =+ "blockfrost-haskell/"+ <> Data.ByteString.Char8.pack+ (Data.Version.showVersion Paths_blockfrost_api.version)
test/Cardano/Accounts.hs view
@@ -37,6 +37,11 @@ `shouldBe` Right accountDelegationHistoryExpected + it "parses account registration sample" $ do+ eitherDecode accountRegistrationSample+ `shouldBe`+ Right accountRegistrationExpected+ it "parses account withdrawal history sample" $ do eitherDecode accountWithdrawalsSample `shouldBe`
test/Cardano/Addresses.hs view
@@ -33,9 +33,9 @@ Right addressDetailsExpected it "parses address utxos sample" $ do- eitherDecode addressUTXOsSample+ eitherDecode addressUtxosSample `shouldBe`- Right addressUTXOsExpected+ Right addressUtxosExpected it "parses address transactions sample" $ do eitherDecode addressTransactionsSample@@ -56,7 +56,8 @@ } ], "stake_address": "stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7",- "type": "shelley"+ "type": "shelley",+ "script": false } |] @@ -73,6 +74,7 @@ ] , _addressInfoStakeAddress = pure "stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7" , _addressInfoType = Shelley+ , _addressInfoScript = False } addressDetailsSample = [r|@@ -119,7 +121,7 @@ ] -addressUTXOsSample = [r|+addressUtxosSample = [r| [ { "tx_hash": "39a7a284c2a0948189dc45dec670211cd4d72f7b66c5726c08d9b3df11e44d58",@@ -131,7 +133,8 @@ "quantity": "42000000" } ],- "block": "7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6"+ "block": "7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6",+ "data_hash": "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710" }, { "tx_hash": "4c4e67bafa15e742c13c592b65c8f74c769cd7d9af04c848099672d1ba391b49",@@ -143,7 +146,8 @@ "quantity": "729235000" } ],- "block": "953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7"+ "block": "953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7",+ "data_hash": null }, { "tx_hash": "768c63e27a1c816a83dc7b07e78af673b2400de8849ea7e7b734ae1333d100d2",@@ -159,28 +163,31 @@ "quantity": "12" } ],- "block": "5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7"+ "block": "5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7",+ "data_hash": null } ] |] -addressUTXOsExpected =- [ AddressUTXO- { _addressUTXOTxHash = "39a7a284c2a0948189dc45dec670211cd4d72f7b66c5726c08d9b3df11e44d58"- , _addressUTXOOutputIndex = 0- , _addressUTXOAmount = [ AdaAmount 42000000 ]- , _addressUTXOBlock = "7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6"+addressUtxosExpected =+ [ AddressUtxo+ { _addressUtxoTxHash = "39a7a284c2a0948189dc45dec670211cd4d72f7b66c5726c08d9b3df11e44d58"+ , _addressUtxoOutputIndex = 0+ , _addressUtxoAmount = [ AdaAmount 42000000 ]+ , _addressUtxoBlock = "7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6"+ , _addressUtxoDataHash = Just "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710" }- , AddressUTXO- { _addressUTXOTxHash = "4c4e67bafa15e742c13c592b65c8f74c769cd7d9af04c848099672d1ba391b49"- , _addressUTXOOutputIndex = 0- , _addressUTXOAmount = [ AdaAmount 729235000 ]- , _addressUTXOBlock = "953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7"+ , AddressUtxo+ { _addressUtxoTxHash = "4c4e67bafa15e742c13c592b65c8f74c769cd7d9af04c848099672d1ba391b49"+ , _addressUtxoOutputIndex = 0+ , _addressUtxoAmount = [ AdaAmount 729235000 ]+ , _addressUtxoBlock = "953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7"+ , _addressUtxoDataHash = Nothing }- , AddressUTXO- { _addressUTXOTxHash = "768c63e27a1c816a83dc7b07e78af673b2400de8849ea7e7b734ae1333d100d2"- , _addressUTXOOutputIndex = 1- , _addressUTXOAmount =+ , AddressUtxo+ { _addressUtxoTxHash = "768c63e27a1c816a83dc7b07e78af673b2400de8849ea7e7b734ae1333d100d2"+ , _addressUtxoOutputIndex = 1+ , _addressUtxoAmount = [ AdaAmount 42000000 , AssetAmount $ Money.mkSomeDiscrete@@ -188,7 +195,8 @@ unitScale 12 ]- , _addressUTXOBlock = "5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7"+ , _addressUtxoBlock = "5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7"+ , _addressUtxoDataHash = Nothing } ]
test/Cardano/Epochs.hs view
@@ -87,7 +87,17 @@ "protocol_minor_ver": 0, "min_utxo": "1000000", "min_pool_cost": "340000000",- "nonce": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81"+ "nonce": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81",+ "price_mem": 0.0577,+ "price_step": 0.0000721,+ "max_tx_ex_mem": "10000000",+ "max_tx_ex_steps": "10000000000",+ "max_block_ex_mem": "50000000",+ "max_block_ex_steps": "40000000000",+ "max_val_size": "5000",+ "collateral_percent": 150,+ "max_collateral_inputs": 3,+ "coins_per_utxo_word": "34482" } |] @@ -107,12 +117,22 @@ , _protocolParamsRho = 0.003 , _protocolParamsTau = 0.2 , _protocolParamsDecentralisationParam = 0.5--- , _protocolParamsExtraEntropy = Nothing+ , _protocolParamsExtraEntropy = Nothing , _protocolParamsProtocolMajorVer = 2 , _protocolParamsProtocolMinorVer = 0 , _protocolParamsMinUtxo = 1000000 , _protocolParamsMinPoolCost = 340000000 , _protocolParamsNonce = "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81"+ , _protocolParamsPriceMem = 0.0577+ , _protocolParamsPriceStep = 0.0000721+ , _protocolParamsMaxTxExMem = 10000000+ , _protocolParamsMaxTxExSteps = 10000000000+ , _protocolParamsMaxBlockExMem = 50000000+ , _protocolParamsMaxBlockExSteps = 40000000000+ , _protocolParamsMaxValSize = 5000+ , _protocolParamsCollateralPercent = 150+ , _protocolParamsMaxCollateralInputs = 3+ , _protocolParamsCoinsPerUtxoWord = 34482 } stakeDistributionSample = [r|
test/Cardano/Metadata.hs view
@@ -123,7 +123,8 @@ }, { "tx_hash": "4237501da3cfdd53ade91e8911e764bd0699d88fd43b12f44a1f459b89bc91be",- "cbor_metadata": "\\xa100a16b436f6d62696e6174696f6e8601010101010c"+ "cbor_metadata": "\\xa100a16b436f6d62696e6174696f6e8601010101010c",+ "metadata": "a100a16b436f6d62696e6174696f6e8601010101010c" } ] |]@@ -137,7 +138,5 @@ Nothing , TxMetaCBOR "4237501da3cfdd53ade91e8911e764bd0699d88fd43b12f44a1f459b89bc91be"- (Just "\\xa100a16b436f6d62696e6174696f6e8601010101010c")+ (Just "a100a16b436f6d62696e6174696f6e8601010101010c") ]--
test/Cardano/Network.hs view
@@ -27,7 +27,10 @@ "supply": { "max": "45000000000000000", "total": "32890715183299160",- "circulating": "32412601976210393"+ "circulating": "32412601976210393",+ "locked": "125006953355",+ "treasury": "98635632000000",+ "reserves": "46635632000000" }, "stake": { "live": "23204950463991654",@@ -38,10 +41,15 @@ networkExpected = Network- (NetworkSupply- 45_000_000_000_000_000- 32_890_715_183_299_160- 32_412_601_976_210_393)- (NetworkStake- 23_204_950_463_991_654- 22_210_233_523_456_321)+ NetworkSupply+ { _supplyMax = 45_000_000_000_000_000+ , _supplyTotal = 32_890_715_183_299_160+ , _supplyCirculating = 32_412_601_976_210_393+ , _supplyLocked = 125_006_953_355+ , _supplyTreasury = 98_635_632_000_000+ , _supplyReserves = 46_635_632_000_000+ }+ NetworkStake+ { _stakeLive = 23_204_950_463_991_654+ , _stakeActive = 22_210_233_523_456_321+ }
test/Cardano/Pools.hs view
@@ -120,6 +120,7 @@ , _poolInfoLiveStake = 6900000000 , _poolInfoLiveSize = 0.42 , _poolInfoLiveSaturation = 0.93+ , _poolInfoLiveDelegators = 127 , _poolInfoActiveStake = 4200000000 , _poolInfoActiveSize = 0.43 , _poolInfoDeclaredPledge = 5000000000
+ test/Cardano/Scripts.hs view
@@ -0,0 +1,137 @@+{-# LANGUAGE NumericUnderscores #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE TemplateHaskell #-}++module Cardano.Scripts+ where++import Data.Aeson (decode, eitherDecode, encode, object, (.=))+import Data.Text (Text)+import qualified Money+import Test.Hspec+import Test.Tasty.Hspec+import Text.RawString.QQ++import Blockfrost.Types++spec_scripts :: Spec+spec_scripts = do+ it "parses script list sample" $ do+ eitherDecode scriptListSample+ `shouldBe`+ Right scriptListExpected++ it "parses script info sample" $ do+ eitherDecode scriptSample+ `shouldBe`+ Right scriptSampleExpected++ it "parses script redeemer sample" $ do+ eitherDecode scriptRedeemerSample+ `shouldBe`+ Right scriptRedeemerExpected++ it "parses script datum sample" $ do+ eitherDecode scriptDatumSample+ `shouldBe`+ Right scriptDatumExpected++ it "parses script JSON sample" $ do+ eitherDecode scriptJSONSample+ `shouldBe`+ Right scriptJSONExpected++ it "parses script CBOR sample" $ do+ eitherDecode scriptCBORSample+ `shouldBe`+ Right scriptCBORExpected++scriptListSample = [r|+[+ {+ "script_hash": "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656"+ },+ {+ "script_hash": "e1457a0c47dfb7a2f6b8fbb059bdceab163c05d34f195b87b9f2b30e"+ },+ {+ "script_hash": "a6e63c0ff05c96943d1cc30bf53112ffff0f34b45986021ca058ec54"+ }+]+|]++scriptListExpected :: [ScriptHash]+scriptListExpected =+ [ "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656"+ , "e1457a0c47dfb7a2f6b8fbb059bdceab163c05d34f195b87b9f2b30e"+ , "a6e63c0ff05c96943d1cc30bf53112ffff0f34b45986021ca058ec54"+ ]++scriptSample = [r|+{+ "script_hash": "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656",+ "type": "plutus",+ "serialised_size": 3119+}+|]++scriptSampleExpected =+ Script+ { _scriptScriptHash = "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656"+ , _scriptType = Plutus+ , _scriptSerialisedSize = Just 3119+ }++scriptRedeemerSample = [r|+{+ "tx_hash": "1a0570af966fb355a7160e4f82d5a80b8681b7955f5d44bec0dce628516157f0",+ "tx_index": 0,+ "purpose": "spend",+ "datum_hash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec",+ "unit_mem": "1700",+ "unit_steps": "476468",+ "fee": "172033"+}+|]++scriptRedeemerExpected =+ ScriptRedeemer+ { _scriptRedeemerTxHash = "1a0570af966fb355a7160e4f82d5a80b8681b7955f5d44bec0dce628516157f0"+ , _scriptRedeemerTxIndex = 0+ , _scriptRedeemerPurpose = Spend+ , _scriptRedeemerDatumHash = "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"+ , _scriptRedeemerUnitMem = 1700+ , _scriptRedeemerUnitSteps = 476468+ , _scriptRedeemerFee = 172033+ }++scriptDatumSample = [r|+{+ "json_value": {+ "int": 42+ }+}+|]++scriptDatumExpected = ScriptDatum $ object ["int" .= (42 :: Int)]++scriptJSONSample = [r|+{+ "json": {+ "type": "sig",+ "keyHash": "8ed9e675aaf99868736c372d5eac9f5b3deae4568f0cde6a7d9e1422"+ }+}+|]++scriptJSONExpected = ScriptJSON $ Just $+ object ["type" .= ("sig" :: String), "keyHash" .= ("8ed9e675aaf99868736c372d5eac9f5b3deae4568f0cde6a7d9e1422" :: String)]++scriptCBORSample = [r|+{+ "cbor": "4e4d01000033222220051200120011"+}+|]++scriptCBORExpected = ScriptCBOR $ Just "4e4d01000033222220051200120011"
test/Cardano/Transactions.hs view
@@ -27,6 +27,11 @@ `shouldBe` Right transactionUtxosExpected + it "parses transaction redeemers sample" $ do+ eitherDecode transactionRedeemerSample+ `shouldBe`+ Right transactionRedeemerExpected+ it "parses transaction stake sample" $ do eitherDecode transactionStakeSample `shouldBe`@@ -96,7 +101,8 @@ "stake_cert_count": 0, "pool_update_count": 0, "pool_retire_count": 0,- "asset_mint_or_burn_count": 0+ "asset_mint_or_burn_count": 0,+ "redeemer_count": 0 } |] @@ -131,6 +137,7 @@ , _transactionPoolUpdateCount = 0 , _transactionPoolRetireCount = 0 , _transactionAssetMintOrBurnCount = 0+ , _transactionRedeemerCount = 0 } transactionUtxosSample = [r|@@ -150,7 +157,9 @@ } ], "tx_hash": "1a0570af966fb355a7160e4f82d5a80b8681b7955f5d44bec0dce628516157f0",- "output_index": 0+ "output_index": 0,+ "collateral": false,+ "data_hash": "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710" } ], "outputs": [@@ -165,7 +174,9 @@ "unit": "b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e", "quantity": "12" }- ]+ ],+ "data_hash": "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710",+ "output_index": 0 } ] }@@ -178,6 +189,8 @@ , _utxoInputAmount = sampleAmounts , _utxoInputTxHash = "1a0570af966fb355a7160e4f82d5a80b8681b7955f5d44bec0dce628516157f0" , _utxoInputOutputIndex = 0+ , _utxoInputCollateral = False+ , _utxoInputDataHash = Just "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710" } utxoOutSample :: UtxoOutput@@ -185,6 +198,8 @@ UtxoOutput { _utxoOutputAddress = "addr1q9ld26v2lv8wvrxxmvg90pn8n8n5k6tdst06q2s856rwmvnueldzuuqmnsye359fqrk8hwvenjnqultn7djtrlft7jnq7dy7wv" , _utxoOutputAmount = sampleAmounts+ , _utxoOutputDataHash = Just "9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710"+ , _utxoOutputOutputIndex = 0 } transactionUtxosExpected =@@ -194,6 +209,29 @@ , _transactionUtxosOutputs = pure utxoOutSample } +transactionRedeemerSample = [r|+{+ "tx_index": 0,+ "purpose": "spend",+ "script_hash": "ec26b89af41bef0f7585353831cb5da42b5b37185e0c8a526143b824",+ "datum_hash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec",+ "unit_mem": "1700",+ "unit_steps": "476468",+ "fee": "172033"+}+|]++transactionRedeemerExpected =+ TransactionRedeemer+ { _transactionRedeemerTxIndex = 0+ , _transactionRedeemerPurpose = Spend+ , _transactionRedeemerScriptHash = "ec26b89af41bef0f7585353831cb5da42b5b37185e0c8a526143b824"+ , _transactionRedeemerDatumHash = "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"+ , _transactionRedeemerUnitMem = 1700+ , _transactionRedeemerUnitSteps = 476468+ , _transactionRedeemerFee = 172033+ }+ transactionStakeSample = [r| { "cert_index": 0,@@ -377,11 +415,11 @@ transactionMetaCBORSample = [r| { "label": "1968",- "cbor_metadata": "\\xa100a16b436f6d62696e6174696f6e8601010101010c"+ "metadata": "a100a16b436f6d62696e6174696f6e8601010101010c" } |] transactionMetaCBORExpected = TransactionMetaCBOR "1968"- (Just "\\xa100a16b436f6d62696e6174696f6e8601010101010c")+ (Just "a100a16b436f6d62696e6174696f6e8601010101010c")