Documentation
¶
Index ¶
- func Fee(context ChainContext, length int, exec_steps int, max_mem_unit int) (int, error)
- type AddressAmount
- type AddressUTXO
- type Block
- type BlockfrostProtocolParams
- type ChainContext
- type CostModelsPlutusVersion
- type Epoch
- type GenesisParameters
- type Input
- type Output
- type ProtocolParameters
- type TxUtxos
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddressAmount ¶
type AddressUTXO ¶
type AddressUTXO struct {
// Transaction hash of the UTXO
TxHash string `json:"tx_hash"`
// UTXO index in the transaction
OutputIndex int `json:"output_index"`
Amount []AddressAmount `json:"amount"`
// Block hash of the UTXO
Block string `json:"block"`
// The hash of the transaction output datum
DataHash string `json:"data_hash"`
InlineDatum string `json:"inline_datum"`
}
type Block ¶
type Block struct {
// Block creation time in UNIX time
Time int `json:"time"`
// Block number
Height int `json:"height"`
// Hash of the block
Hash string `json:"hash"`
// Slot number
Slot int `json:"slot"`
// Epoch number
Epoch int `json:"epoch"`
// Slot within the epoch
EpochSlot int `json:"epoch_slot"`
// Bech32 ID of the slot leader or specific block description in case there is no slot leader
SlotLeader string `json:"slot_leader"`
// Block size in Bytes
Size int `json:"size"`
// Number of transactions in the block
TxCount int `json:"tx_count"`
// Total output within the block in Lovelaces
Output string `json:"output"`
// Total fees within the block in Lovelaces
Fees string `json:"fees"`
// VRF key of the block
BlockVRF string `json:"block_vrf"`
// Hash of the previous block
PreviousBlock string `json:"previous_block"`
// Hash of the next block
NextBlock string `json:"next_block"`
// Number of block confirmations
Confirmations int `json:"confirmations"`
}
type BlockfrostProtocolParams ¶ added in v1.1.0
type BlockfrostProtocolParams struct {
MinFeeConstant int `json:"min_fee_b"`
MinFeeCoefficient int `json:"min_fee_a"`
MaxBlockSize int `json:"max_block_size"`
MaxTxSize int `json:"max_tx_size"`
MaxBlockHeaderSize int `json:"max_block_header_size"`
KeyDeposits string `json:"key_deposit"`
PoolDeposits string `json:"pool_deposit"`
PooolInfluence float32 `json:"a0"`
MonetaryExpansion float32 `json:"rho"`
TreasuryExpansion float32 `json:"tau"`
DecentralizationParam float32 `json:"decentralisation_param"`
ExtraEntropy string `json:"extra_entropy"`
ProtocolMajorVersion int `json:"protocol_major_ver"`
ProtocolMinorVersion int `json:"protocol_minor_ver"`
MinUtxo string `json:"min_utxo"`
MinPoolCost string `json:"min_pool_cost"`
PriceMem float32 `json:"price_mem"`
PriceStep float32 `json:"price_step"`
MaxTxExMem string `json:"max_tx_ex_mem"`
MaxTxExSteps string `json:"max_tx_ex_steps"`
MaxBlockExMem string `json:"max_block_ex_mem"`
MaxBlockExSteps string `json:"max_block_ex_steps"`
MaxValSize string `json:"max_val_size"`
CollateralPercent int `json:"collateral_percent"`
MaxCollateralInuts int `json:"max_collateral_inputs"`
CoinsPerUtxoWord string `json:"coins_per_utxo_word"`
CoinsPerUtxoByte string `json:"coins_per_utxo_byte"`
//CostModels //map[string][]uint64 `json:"cost_models"`
MaximumReferenceScriptsSize int `json:"maximum_reference_scripts_size"`
MinFeeReferenceScriptsRange int `json:"min_fee_reference_scripts_range"`
MinFeeReferenceScriptsBase int `json:"min_fee_reference_scripts_base"`
MinFeeReferenceScriptsMultiplier int `json:"min_fee_reference_scripts_multiplier"`
}
func (BlockfrostProtocolParams) ToBaseParams ¶ added in v1.1.0
func (p BlockfrostProtocolParams) ToBaseParams() ProtocolParameters
type ChainContext ¶
type ChainContext interface {
GetProtocolParams() (ProtocolParameters, error)
GetGenesisParams() (GenesisParameters, error)
Network() int
Epoch() (int, error)
MaxTxFee() (int, error)
LastBlockSlot() (int, error)
Utxos(address Address.Address) ([]UTxO.UTxO, error)
SubmitTx(Transaction.Transaction) (serialization.TransactionId, error)
EvaluateTx([]uint8) (map[string]Redeemer.ExecutionUnits, error)
EvaluateTxWithAdditionalUtxos([]uint8, []UTxO.UTxO) (map[string]Redeemer.ExecutionUnits, error)
GetUtxoFromRef(txHash string, txIndex int) (*UTxO.UTxO, error)
GetContractCbor(scriptHash string) (string, error)
CostModelsV1() PlutusData.CostModel
CostModelsV2() PlutusData.CostModel
CostModelsV3() PlutusData.CostModel
}
type CostModelsPlutusVersion ¶ added in v1.7.0
type CostModelsPlutusVersion int
CostModelsPlutusVersion identifies the Plutus language version that a cost model applies to.
const ( // CostModelsPlutusV1 identifies Plutus V1 cost models. CostModelsPlutusV1 CostModelsPlutusVersion = iota // CostModelsPlutusV2 identifies Plutus V2 cost models. CostModelsPlutusV2 // CostModelsPlutusV3 identifies Plutus V3 cost models. CostModelsPlutusV3 )
type Epoch ¶
type Epoch struct {
// Sum of all the active stakes within the epoch in Lovelaces
ActiveStake string `json:"active_stake"`
// Number of blocks within the epoch
BlockCount int `json:"block_count"`
// Unix time of the end of the epoch
EndTime int `json:"end_time"`
// Epoch number
Epoch int `json:"epoch"`
// Sum of all the fees within the epoch in Lovelaces
Fees string `json:"fees"`
// Unix time of the first block of the epoch
FirstBlockTime int `json:"first_block_time"`
// Unix time of the last block of the epoch
LastBlockTime int `json:"last_block_time"`
// Sum of all the transactions within the epoch in Lovelaces
Output string `json:"output"`
// Unix time of the start of the epoch
StartTime int `json:"start_time"`
// Number of transactions within the epoch
TxCount int `json:"tx_count"`
}
type GenesisParameters ¶
type GenesisParameters struct {
ActiveSlotsCoefficient float32 `json:"active_slots_coefficient"`
UpdateQuorum int `json:"update_quorum"`
MaxLovelaceSupply string `json:"max_lovelace_supply"`
NetworkMagic int `json:"network_magic"`
EpochLength int `json:"epoch_length"`
SystemStart int `json:"system_start"`
SlotsPerKesPeriod int `json:"slots_per_kes_period"`
SlotLength int `json:"slot_length"`
MaxKesEvolutions int `json:"max_kes_evolutions"`
SecurityParam int `json:"security_param"`
}
type Input ¶
type Input struct {
Address string `json:"address"`
Amount []AddressAmount `json:"amount"`
OutputIndex int `json:"output_index"`
DataHash string `json:"data_hash"`
InlineDatum string `json:"inline_datum"`
ReferenceScriptHash string `json:"reference_script_hash"`
Collateral bool `json:"collateral"`
Reference bool `json:"reference"`
}
type Output ¶
type Output struct {
Address string `json:"address"`
Amount []AddressAmount `json:"amount"`
OutputIndex int `json:"output_index"`
DataHash string `json:"data_hash"`
InlineDatum string `json:"inline_datum"`
Collateral bool `json:"collateral"`
ReferenceScriptHash string `json:"reference_script_hash"`
}
func (Output) ToTransactionOutput ¶
func (o Output) ToTransactionOutput() (TransactionOutput.TransactionOutput, error)
type ProtocolParameters ¶
type ProtocolParameters struct {
MinFeeConstant int64 `json:"min_fee_b"`
MinFeeCoefficient int64 `json:"min_fee_a"`
MaxBlockSize int `json:"max_block_size"`
MaxTxSize int `json:"max_tx_size"`
MaxBlockHeaderSize int `json:"max_block_header_size"`
KeyDeposits string `json:"key_deposit"`
PoolDeposits string `json:"pool_deposit"`
PooolInfluence float32 `json:"a0"`
MonetaryExpansion float32 `json:"rho"`
TreasuryExpansion float32 `json:"tau"`
DecentralizationParam float32 `json:"decentralisation_param"`
ExtraEntropy string `json:"extra_entropy"`
ProtocolMajorVersion int `json:"protocol_major_ver"`
ProtocolMinorVersion int `json:"protocol_minor_ver"`
MinUtxo string `json:"min_utxo"`
MinPoolCost string `json:"min_pool_cost"`
PriceMem float32 `json:"price_mem"`
PriceStep float32 `json:"price_step"`
MaxTxExMem string `json:"max_tx_ex_mem"`
MaxTxExSteps string `json:"max_tx_ex_steps"`
MaxBlockExMem string `json:"max_block_ex_mem"`
MaxBlockExSteps string `json:"max_block_ex_steps"`
MaxValSize string `json:"max_val_size"`
CollateralPercent int `json:"collateral_percent"`
MaxCollateralInuts int `json:"max_collateral_inputs"`
CoinsPerUtxoWord string `json:"coins_per_utxo_word"`
CoinsPerUtxoByte string `json:"coins_per_utxo_byte"`
// Raw cost model values keyed by language
// version string.
CostModelsRaw map[string][]int64 `json:"cost_models"`
// Processed cost models keyed by Plutus version.
// Not serialized; derived from CostModelsRaw.
CostModels map[CostModelsPlutusVersion]PlutusData.CostModel `json:"-"`
MaximumReferenceScriptsSize int `json:"maximum_reference_scripts_size"`
MinFeeReferenceScriptsRange int `json:"min_fee_reference_scripts_range"`
MinFeeReferenceScriptsBase int `json:"min_fee_reference_scripts_base"`
MinFeeReferenceScriptsMultiplier int `json:"min_fee_reference_scripts_multiplier"`
}
func (ProtocolParameters) GetCoinsPerUtxoByte ¶
func (p ProtocolParameters) GetCoinsPerUtxoByte() int
Click to show internal directories.
Click to hide internal directories.