Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterProvider(host *plugin.Host) error
- func SetPaginationHeaders(w http.ResponseWriter, totalItems int, params PaginationParams)
- type AccountAssociatedAddressInfo
- type AccountAssociatedAddressResponse
- type AccountDelegationHistoryInfo
- type AccountDelegationHistoryResponse
- type AccountInfo
- type AccountRegistrationHistoryInfo
- type AccountRegistrationHistoryResponse
- type AccountResponse
- type AccountRewardHistoryInfo
- type AccountRewardHistoryResponse
- type AccountTransactionInfo
- type AccountTransactionResponse
- type AccountTransactionsParams
- type AccountUTXOInfo
- type AccountUTXOResponse
- type AccountWithdrawalInfo
- type AccountWithdrawalResponse
- type AddressAmountInfo
- type AddressAmountResponse
- type AddressInfo
- type AddressResponse
- type AddressTransactionInfo
- type AddressTransactionResponse
- type AddressUTXOInfo
- type AddressUTXOResponse
- type AssetAddressResponse
- type AssetHolderInfo
- type AssetInfo
- type AssetResponse
- type BlockInfo
- type BlockRangePosition
- type BlockResponse
- type Blockfrost
- type BlockfrostConfig
- type BlockfrostNode
- type ChainTipInfo
- type DRepCredential
- type DRepInfo
- type DRepListItemInfo
- type DRepListItemResponse
- type DRepListParams
- type DRepMetadataInfo
- type DRepMetadataResponse
- type DRepResponse
- type EpochInfo
- type EpochResponse
- type ErrorResponse
- type ExecutionUnitsResponse
- type GenesisInfo
- type GenesisResponse
- type HealthResponse
- type MetadataTransactionCBORInfo
- type MetadataTransactionCBORResponse
- type MetadataTransactionJSONInfo
- type MetadataTransactionJSONResponse
- type NetworkEraBound
- type NetworkEraBoundInfo
- type NetworkEraInfo
- type NetworkEraParameters
- type NetworkEraParamsInfo
- type NetworkEraResponse
- type NetworkInfo
- type NetworkResponse
- type NetworkStake
- type NetworkStakeInfo
- type NetworkSupply
- type NetworkSupplyInfo
- type NodeAdapter
- func (a *NodeAdapter) Account(stakeAddress string) (AccountInfo, error)
- func (a *NodeAdapter) AccountAssociatedAddresses(stakeAddress string, params PaginationParams) ([]AccountAssociatedAddressInfo, int, error)
- func (a *NodeAdapter) AccountDelegationHistory(stakeAddress string, params PaginationParams) ([]AccountDelegationHistoryInfo, int, error)
- func (a *NodeAdapter) AccountRegistrationHistory(stakeAddress string, params PaginationParams) ([]AccountRegistrationHistoryInfo, int, error)
- func (a *NodeAdapter) AccountRewardHistory(stakeAddress string, params PaginationParams) ([]AccountRewardHistoryInfo, int, error)
- func (a *NodeAdapter) AccountTransactions(stakeAddress string, params AccountTransactionsParams) ([]AccountTransactionInfo, int, error)
- func (a *NodeAdapter) AccountUTXOs(stakeAddress string, params PaginationParams) ([]AccountUTXOInfo, int, error)
- func (a *NodeAdapter) AccountWithdrawals(stakeAddress string, params PaginationParams) ([]AccountWithdrawalInfo, int, error)
- func (a *NodeAdapter) Address(address string) (AddressInfo, error)
- func (a *NodeAdapter) AddressTransactions(address string, params PaginationParams) ([]AddressTransactionInfo, int, error)
- func (a *NodeAdapter) AddressUTXOs(address string, params PaginationParams) ([]AddressUTXOInfo, int, error)
- func (a *NodeAdapter) Asset(policyID string, assetName []byte) (AssetInfo, error)
- func (a *NodeAdapter) AssetAddresses(policyID string, assetName []byte, params PaginationParams) ([]AssetHolderInfo, int, error)
- func (a *NodeAdapter) BlockByHashOrNumber(id string) (BlockInfo, error)
- func (a *NodeAdapter) ChainTip() (ChainTipInfo, error)
- func (a *NodeAdapter) CurrentEpoch() (EpochInfo, error)
- func (a *NodeAdapter) CurrentProtocolParams() (ProtocolParamsInfo, error)
- func (a *NodeAdapter) DRep(credential DRepCredential) (DRepInfo, error)
- func (a *NodeAdapter) DReps(params DRepListParams) ([]DRepListItemInfo, int, error)
- func (a *NodeAdapter) EpochProtocolParams(epoch uint64) (ProtocolParamsInfo, error)
- func (a *NodeAdapter) Genesis() (GenesisInfo, error)
- func (a *NodeAdapter) LatestBlock() (BlockInfo, error)
- func (a *NodeAdapter) LatestBlockTxHashes() ([]string, error)
- func (a *NodeAdapter) MetadataTransactions(label uint64, params PaginationParams) ([]MetadataTransactionJSONInfo, int, error)
- func (a *NodeAdapter) MetadataTransactionsCBOR(label uint64, params PaginationParams) ([]MetadataTransactionCBORInfo, int, error)
- func (a *NodeAdapter) Network() (NetworkInfo, error)
- func (a *NodeAdapter) NetworkEras() ([]NetworkEraInfo, error)
- func (a *NodeAdapter) PoolDetail(poolID string) (PoolDetailInfo, error)
- func (a *NodeAdapter) PoolMetadata(poolID string) (PoolMetadataInfo, error)
- func (a *NodeAdapter) PoolsExtended() ([]PoolExtendedInfo, error)
- func (a *NodeAdapter) PoolsList(params PaginationParams) ([]string, int, error)
- func (a *NodeAdapter) PoolsRetiring(params PaginationParams) ([]PoolRetiringInfo, int, error)
- func (a *NodeAdapter) Transaction(hash []byte) (TransactionInfo, error)
- func (a *NodeAdapter) TransactionCBOR(hash []byte) ([]byte, error)
- func (a *NodeAdapter) TransactionDelegations(hash []byte) ([]TransactionDelegationInfo, error)
- func (a *NodeAdapter) TransactionEvaluate(txCbor []byte) (TransactionEvaluationResponse, error)
- func (a *NodeAdapter) TransactionMIRs(hash []byte) ([]TransactionMIRInfo, error)
- func (a *NodeAdapter) TransactionMetadata(hash []byte) ([]TransactionMetadataInfo, error)
- func (a *NodeAdapter) TransactionMetadataCBOR(hash []byte) ([]TransactionMetadataCBORInfo, error)
- func (a *NodeAdapter) TransactionPoolRetires(hash []byte) ([]TransactionPoolRetireInfo, error)
- func (a *NodeAdapter) TransactionPoolUpdates(hash []byte) ([]TransactionPoolUpdateInfo, error)
- func (a *NodeAdapter) TransactionRedeemers(hash []byte) ([]TransactionRedeemerInfo, error)
- func (a *NodeAdapter) TransactionRequiredSigners(hash []byte) ([]TransactionRequiredSignerInfo, error)
- func (a *NodeAdapter) TransactionStakeAddresses(hash []byte) ([]TransactionStakeAddressInfo, error)
- func (a *NodeAdapter) TransactionSubmit(txCbor []byte) (string, error)
- func (a *NodeAdapter) TransactionUTXOs(hash []byte) (TransactionUTXOsInfo, error)
- func (a *NodeAdapter) TransactionWithdrawals(hash []byte) ([]TransactionWithdrawalInfo, error)
- type OffchainFetchErrorInfo
- type OffchainFetchErrorResponse
- type PaginationParams
- type PoolCalidusKeyInfo
- type PoolCalidusKeyResponse
- type PoolDetailInfo
- type PoolDetailResponse
- type PoolExtendedInfo
- type PoolExtendedMetadataInfo
- type PoolExtendedMetadataResponse
- type PoolExtendedResponse
- type PoolMetadataInfo
- type PoolMetadataResponse
- type PoolRetiringInfo
- type PoolRetiringResponse
- type ProtocolParamsInfo
- type ProtocolParamsResponse
- type ProviderConfig
- type ProviderDependencies
- type RootResponse
- type TransactionCBORResponse
- type TransactionDelegationInfo
- type TransactionDelegationResponse
- type TransactionEvaluationEnvelope
- type TransactionEvaluationResponse
- type TransactionEvaluationResult
- type TransactionInfo
- type TransactionInputInfo
- type TransactionInputResponse
- type TransactionMIRInfo
- type TransactionMIRResponse
- type TransactionMetadataCBORInfo
- type TransactionMetadataCBORResponse
- type TransactionMetadataInfo
- type TransactionMetadataResponse
- type TransactionOutputInfo
- type TransactionOutputResponse
- type TransactionPoolMetadataInfo
- type TransactionPoolMetadataResponse
- type TransactionPoolRelayInfo
- type TransactionPoolRelayResponse
- type TransactionPoolRetireInfo
- type TransactionPoolRetireResponse
- type TransactionPoolUpdateInfo
- type TransactionPoolUpdateResponse
- type TransactionRedeemerInfo
- type TransactionRedeemerResponse
- type TransactionRejectedError
- type TransactionRequiredSignerInfo
- type TransactionRequiredSignerResponse
- type TransactionResponse
- type TransactionStakeAddressInfo
- type TransactionStakeAddressResponse
- type TransactionSubmitter
- type TransactionUTXOsInfo
- type TransactionUTXOsResponse
- type TransactionWithdrawalInfo
- type TransactionWithdrawalResponse
Constants ¶
const ( DefaultPaginationCount = 100 MaxPaginationCount = 100 DefaultPaginationPage = 1 PaginationOrderAsc = "asc" PaginationOrderDesc = "desc" )
const MaxPaginationPage = 21474836
MaxPaginationPage mirrors the hosted Blockfrost fastify schema bound for the page parameter.
Variables ¶
var ( ErrInvalidAddress = errors.New("invalid address") ErrAddressNotFound = errors.New("address not found") ErrInvalidBlockID = errors.New("invalid block id") ErrBlockNotFound = errors.New("block not found") ErrEpochNotFound = errors.New("epoch not found") ErrAssetNotFound = errors.New("asset not found") ErrDRepNotFound = errors.New("drep not found") ErrInvalidTransaction = errors.New("invalid transaction") // ErrTransactionRejected reports a well-formed transaction the mempool // declined, e.g. failing script validation or an unresolvable input. It // is distinct from ErrInvalidTransaction so submission does not report a // decodable transaction as malformed CBOR. ErrTransactionRejected = errors.New("transaction rejected") // ErrTransactionEvaluation reports a transaction that decoded cleanly but // could not be evaluated, e.g. an input the ledger cannot resolve or a // script that fails. It is deliberately distinct from // ErrInvalidTransaction so the evaluation endpoints do not report a // well-formed transaction as malformed CBOR. ErrTransactionEvaluation = errors.New("transaction evaluation failed") // ErrLedgerUnavailable reports a submission or evaluation that failed // because the node's own storage could not answer, not because the // transaction was at fault. It is the ledger-side counterpart of // ErrMempoolUnavailable: both name a node condition the caller can // retry rather than a transaction it must fix. ErrInvalidPoolID = errors.New("invalid pool id") ErrMempoolFull = errors.New("mempool full") ErrTransactionNotFound = errors.New("transaction not found") ErrInvalidStakeAddress = errors.New("invalid stake address") // for the requested point. Byron carries no protocol-parameter CBOR, so a // genuine Byron prefix reaches this during a from-genesis sync; it is an // expected state rather than a node fault, and callers must not // substitute Shelley-shaped defaults for it. ErrProtocolParamsUnavailable = errors.New( "protocol parameters not available", ) )
var ErrInvalidBlockRange = errors.New("invalid block range position")
ErrInvalidBlockRange is returned when a from/to query value is not a valid block number or "block:index" position.
var ErrInvalidPaginationParameters = errors.New(
"invalid pagination parameters",
)
Functions ¶
func RegisterProvider ¶ added in v0.68.0
func SetPaginationHeaders ¶
func SetPaginationHeaders( w http.ResponseWriter, totalItems int, params PaginationParams, )
SetPaginationHeaders sets Blockfrost pagination headers.
Types ¶
type AccountAssociatedAddressInfo ¶
type AccountAssociatedAddressInfo struct {
Address string
}
AccountAssociatedAddressInfo holds a payment address associated with a stake key.
type AccountAssociatedAddressResponse ¶
type AccountAssociatedAddressResponse struct {
Address string `json:"address"`
}
AccountAssociatedAddressResponse represents a stake account associated payment address.
type AccountDelegationHistoryInfo ¶
type AccountDelegationHistoryInfo struct {
ActiveEpoch int32
TxHash string
Amount string
PoolID string
TxSlot int64
BlockTime int64
BlockHeight int64
}
AccountDelegationHistoryInfo holds a stake-account delegation history row.
type AccountDelegationHistoryResponse ¶
type AccountDelegationHistoryResponse struct {
ActiveEpoch int32 `json:"active_epoch"`
TxHash string `json:"tx_hash"`
Amount string `json:"amount"`
PoolID string `json:"pool_id"`
TxSlot int64 `json:"tx_slot"`
BlockTime int64 `json:"block_time"`
BlockHeight int64 `json:"block_height"`
}
AccountDelegationHistoryResponse represents a stake-account delegation history row.
type AccountInfo ¶
type AccountInfo struct {
StakeAddress string
Active bool
ActiveEpoch *int64
ControlledAmount string
RewardsSum string
WithdrawalsSum string
ReservesSum string
TreasurySum string
WithdrawableAmount string
PoolID *string
DrepID *string
Registered bool
}
AccountInfo holds stake-account data needed by the API.
type AccountRegistrationHistoryInfo ¶
type AccountRegistrationHistoryInfo struct {
TxHash string
Action string
Deposit string
TxSlot int64
BlockTime int64
BlockHeight int64
}
AccountRegistrationHistoryInfo holds a stake-account registration history row.
type AccountRegistrationHistoryResponse ¶
type AccountRegistrationHistoryResponse struct {
TxHash string `json:"tx_hash"`
Action string `json:"action"`
Deposit string `json:"deposit"`
TxSlot int64 `json:"tx_slot"`
BlockTime int64 `json:"block_time"`
BlockHeight int64 `json:"block_height"`
}
AccountRegistrationHistoryResponse represents a stake-account registration history row.
type AccountResponse ¶
type AccountResponse struct {
StakeAddress string `json:"stake_address"`
Active bool `json:"active"`
ActiveEpoch *int64 `json:"active_epoch"`
ControlledAmount string `json:"controlled_amount"`
RewardsSum string `json:"rewards_sum"`
WithdrawalsSum string `json:"withdrawals_sum"`
ReservesSum string `json:"reserves_sum"`
TreasurySum string `json:"treasury_sum"`
WithdrawableAmount string `json:"withdrawable_amount"`
PoolID *string `json:"pool_id"`
DrepID *string `json:"drep_id"`
Registered bool `json:"registered"`
}
AccountResponse represents a Blockfrost stake account.
type AccountRewardHistoryInfo ¶
type AccountRewardHistoryInfo struct {
Epoch int32
Amount string
PoolID string
// Type is the Blockfrost reward-type enum spelling (leader, member,
// pool_deposit_refund) mapped from models.RewardAccountOutput.RewardType.
Type string
}
AccountRewardHistoryInfo holds a stake-account reward history row.
type AccountRewardHistoryResponse ¶
type AccountRewardHistoryResponse struct {
Epoch int32 `json:"epoch"`
Amount string `json:"amount"`
PoolID string `json:"pool_id"`
// Type is one of leader, member, or pool_deposit_refund, per the
// Blockfrost account_reward_content schema.
Type string `json:"type"`
}
AccountRewardHistoryResponse represents a stake-account reward history row.
type AccountTransactionInfo ¶ added in v0.69.0
type AccountTransactionInfo struct {
Address string
TxHash string
TxIndex uint32
BlockHeight uint64
BlockTime int64
}
AccountTransactionInfo holds a stake-account transaction row: one entry per distinct address (sharing the stake credential) involved in the transaction.
type AccountTransactionResponse ¶ added in v0.69.0
type AccountTransactionResponse struct {
Address string `json:"address"`
TxHash string `json:"tx_hash"`
TxIndex int `json:"tx_index"`
BlockHeight uint64 `json:"block_height"`
BlockTime int `json:"block_time"`
}
AccountTransactionResponse represents a stake-account transaction object.
type AccountTransactionsParams ¶ added in v0.69.0
type AccountTransactionsParams struct {
Pagination PaginationParams
From *BlockRangePosition
To *BlockRangePosition
}
AccountTransactionsParams holds query parameters for the account transactions endpoint: standard pagination plus the optional inclusive from/to block-range filter.
type AccountUTXOInfo ¶ added in v0.69.0
type AccountUTXOInfo struct {
Address string
TxHash string
// TxIndex is the deprecated Blockfrost alias for OutputIndex (the UTxO's
// index within its producing transaction); it carries the same value.
TxIndex uint32
OutputIndex uint32
Amount []AddressAmountInfo
Block string
DataHash *string
InlineDatum *string
ReferenceScriptHash *string
}
AccountUTXOInfo holds a stake-account UTxO row.
type AccountUTXOResponse ¶ added in v0.69.0
type AccountUTXOResponse struct {
Address string `json:"address"`
TxHash string `json:"tx_hash"`
// TxIndex is a deprecated Blockfrost alias for OutputIndex ("UTXO index
// in the transaction"), kept for schema compatibility.
TxIndex int `json:"tx_index"`
OutputIndex int `json:"output_index"`
Amount []AddressAmountResponse `json:"amount"`
Block string `json:"block"`
DataHash *string `json:"data_hash"`
InlineDatum *string `json:"inline_datum"`
ReferenceScriptHash *string `json:"reference_script_hash"`
}
AccountUTXOResponse represents a Blockfrost stake-account UTxO object.
type AccountWithdrawalInfo ¶ added in v0.69.0
type AccountWithdrawalInfo struct {
TxHash string
Amount string
TxSlot int64
BlockTime int64
BlockHeight int64
}
AccountWithdrawalInfo holds a stake-account withdrawal history row.
type AccountWithdrawalResponse ¶ added in v0.69.0
type AccountWithdrawalResponse struct {
TxHash string `json:"tx_hash"`
Amount string `json:"amount"`
TxSlot int64 `json:"tx_slot"`
BlockTime int64 `json:"block_time"`
BlockHeight int64 `json:"block_height"`
}
AccountWithdrawalResponse represents a stake-account withdrawal history row.
type AddressAmountInfo ¶
AddressAmountInfo holds amount data needed by address UTxO responses.
type AddressAmountResponse ¶
AddressAmountResponse represents a Blockfrost address amount object.
type AddressInfo ¶ added in v0.68.0
type AddressInfo struct {
Address string
Amount []AddressAmountInfo
StakeAddress *string
Type string
Script bool
}
AddressInfo holds address summary data needed by the API.
type AddressResponse ¶ added in v0.68.0
type AddressResponse struct {
Address string `json:"address"`
Amount []AddressAmountResponse `json:"amount"`
StakeAddress *string `json:"stake_address"`
Type string `json:"type"`
Script bool `json:"script"`
}
AddressResponse represents a Blockfrost address summary object.
type AddressTransactionInfo ¶
type AddressTransactionInfo struct {
TxHash string
TxIndex uint32
BlockHeight uint64
BlockTime int64
}
AddressTransactionInfo holds address transaction data needed by the API.
type AddressTransactionResponse ¶
type AddressTransactionResponse struct {
TxHash string `json:"tx_hash"`
TxIndex int `json:"tx_index"`
BlockHeight uint64 `json:"block_height"`
BlockTime int `json:"block_time"`
}
AddressTransactionResponse represents a Blockfrost address transaction object.
type AddressUTXOInfo ¶
type AddressUTXOInfo struct {
Address string
TxHash string
// TxIndex is the deprecated Blockfrost alias for OutputIndex (the UTxO's
// index within its producing transaction); it carries the same value.
TxIndex uint32
OutputIndex uint32
Amount []AddressAmountInfo
Block string
DataHash *string
InlineDatum *string
ReferenceScriptHash *string
}
AddressUTXOInfo holds address UTxO data needed by the API.
type AddressUTXOResponse ¶
type AddressUTXOResponse struct {
Address string `json:"address"`
TxHash string `json:"tx_hash"`
// TxIndex is a deprecated Blockfrost alias for OutputIndex ("UTXO index
// in the transaction"), kept for schema compatibility.
TxIndex int `json:"tx_index"`
OutputIndex int `json:"output_index"`
Amount []AddressAmountResponse `json:"amount"`
Block string `json:"block"`
DataHash *string `json:"data_hash"`
InlineDatum *string `json:"inline_datum"`
ReferenceScriptHash *string `json:"reference_script_hash"`
}
AddressUTXOResponse represents a Blockfrost address UTxO object.
type AssetAddressResponse ¶ added in v0.62.0
type AssetAddressResponse struct {
Address string `json:"address"`
Quantity string `json:"quantity"`
}
AssetAddressResponse represents one entry in the GET /assets/{asset}/addresses response.
type AssetHolderInfo ¶ added in v0.62.0
AssetHolderInfo holds address and quantity data for a single asset holder.
type AssetInfo ¶
type AssetInfo struct {
OnchainMetadata *any
OnchainMetadataStandard *string
OnchainMetadataExtra *string
Metadata *any
Asset string
PolicyID string
AssetName string
AssetNameASCII string
Fingerprint string
Quantity string
InitialMintTxHash string
MintOrBurnCount int
}
AssetInfo holds native asset data needed by the API.
type AssetResponse ¶
type AssetResponse struct {
Asset string `json:"asset"`
PolicyID string `json:"policy_id"`
AssetName string `json:"asset_name"`
AssetNameASCII string `json:"asset_name_ascii"`
Fingerprint string `json:"fingerprint"`
Quantity string `json:"quantity"`
InitialMintTxHash string `json:"initial_mint_tx_hash"`
MintOrBurnCount int `json:"mint_or_burn_count"`
OnchainMetadata *any `json:"onchain_metadata"`
OnchainMetadataStandard *string `json:"onchain_metadata_standard"`
OnchainMetadataExtra *string `json:"onchain_metadata_extra"`
Metadata *any `json:"metadata"`
}
AssetResponse represents a Blockfrost native asset object.
type BlockInfo ¶
type BlockInfo struct {
Hash string
Slot uint64
Epoch uint64
EpochSlot uint64
Height uint64
Time int64
Size uint64
TxCount int
SlotLeader string
PreviousBlock string
Confirmations uint64
// Output is the total lovelace output of the block's transactions.
Output string
// Fees is the total lovelace fees of the block's transactions.
Fees string
// BlockVRF is the bech32-encoded (vrf_vk) VRF verification key from the
// Praos/TPraos header, or nil for Byron/unknown headers.
BlockVRF *string
// OPCert is the hex-encoded operational certificate hot vkey, or nil for
// Byron/unknown headers.
OPCert *string
// OPCertCounter is the operational certificate issue counter as a decimal
// string, or nil for Byron/unknown headers.
OPCertCounter *string
// NextBlock is the hash of the block that builds on this one, or nil when
// this block is the chain tip.
NextBlock *string
}
BlockInfo holds block data needed by the API.
type BlockRangePosition ¶ added in v0.69.0
BlockRangePosition holds a parsed Blockfrost account-transactions from/to query value: a block number and an optional transaction index within that block (the "block:index" form).
type BlockResponse ¶
type BlockResponse struct {
Time int64 `json:"time"`
Height uint64 `json:"height"`
Hash string `json:"hash"`
Slot uint64 `json:"slot"`
Epoch uint64 `json:"epoch"`
EpochSlot uint64 `json:"epoch_slot"`
SlotLeader string `json:"slot_leader"`
Size uint64 `json:"size"`
TxCount int `json:"tx_count"`
Output *string `json:"output"`
Fees *string `json:"fees"`
BlockVRF *string `json:"block_vrf"`
OPCert *string `json:"op_cert"`
OPCertCounter *string `json:"op_cert_counter"`
PreviousBlock string `json:"previous_block"`
NextBlock *string `json:"next_block"`
Confirmations uint64 `json:"confirmations"`
}
BlockResponse represents a Blockfrost block object.
type Blockfrost ¶
type Blockfrost struct {
// contains filtered or unexported fields
}
Blockfrost is the Blockfrost-compatible REST API server.
func New ¶
func New( cfg BlockfrostConfig, node BlockfrostNode, logger *slog.Logger, ) *Blockfrost
New creates a new Blockfrost API server instance.
type BlockfrostConfig ¶
type BlockfrostConfig struct {
// ListenAddress is the address to listen on.
// Defaults to ":3000".
ListenAddress string
// CORSAllowedOrigins configures Access-Control-Allow-Origin.
// Empty disables CORS.
CORSAllowedOrigins []string
// TLS and Auth are the resolved (merged, validated) TLS/authentication
// policy for this listener -- see ProviderConfig's doc comment and
// ARCHITECTURE.md's "API security" section.
TLS apiconfig.EffectiveTLS
Auth apiconfig.EffectiveAuth
}
BlockfrostConfig holds configuration for the Blockfrost API server.
type BlockfrostNode ¶
type BlockfrostNode interface {
// ChainTip returns the current chain tip info.
ChainTip() (ChainTipInfo, error)
// LatestBlock returns information about the latest
// block on the chain.
LatestBlock() (BlockInfo, error)
// BlockByHashOrNumber returns information about a block
// identified by a 64-character hex hash or decimal height.
BlockByHashOrNumber(id string) (BlockInfo, error)
// LatestBlockTxHashes returns the transaction hashes
// for the latest block.
LatestBlockTxHashes() ([]string, error)
// CurrentEpoch returns information about the current
// epoch.
CurrentEpoch() (EpochInfo, error)
// CurrentProtocolParams returns the current protocol
// parameters.
CurrentProtocolParams() (ProtocolParamsInfo, error)
// EpochProtocolParams returns protocol parameters for a
// specific epoch.
EpochProtocolParams(epoch uint64) (ProtocolParamsInfo, error)
// Network returns current network supply and stake information.
Network() (NetworkInfo, error)
// NetworkEras returns hard-fork era summaries.
NetworkEras() ([]NetworkEraInfo, error)
// Genesis returns Shelley genesis configuration values.
Genesis() (GenesisInfo, error)
// PoolsExtended returns the current active pools with
// extended details.
PoolsExtended() ([]PoolExtendedInfo, error)
// PoolsList returns the paginated list of registered (active,
// non-retired) stake pool IDs, along with the total number of
// matching results before pagination.
PoolsList(PaginationParams) ([]string, int, error)
// Address returns summary information for an address,
// including balances aggregated across its live UTxOs.
Address(address string) (AddressInfo, error)
// PoolsRetiring returns the paginated list of pools with a
// pending retirement announcement, along with the total number
// of matching results before pagination.
PoolsRetiring(PaginationParams) ([]PoolRetiringInfo, int, error)
// PoolMetadata returns the registered metadata for a pool.
PoolMetadata(poolID string) (PoolMetadataInfo, error)
// PoolDetail returns the OpenAPI pool detail object for the requested
// pool (bech32 or hex ID), computing epoch-sensitive aggregates
// (blocks_epoch, live/active stake, saturation) as of the current
// epoch.
PoolDetail(poolID string) (PoolDetailInfo, error)
// AddressUTXOs returns the paginated current UTxOs for
// an address along with the total number of matching
// results before pagination.
AddressUTXOs(
address string,
params PaginationParams,
) ([]AddressUTXOInfo, int, error)
// AddressTransactions returns the paginated transaction
// history for an address along with the total number of
// matching results before pagination.
AddressTransactions(
address string,
params PaginationParams,
) ([]AddressTransactionInfo, int, error)
// MetadataTransactions returns the paginated transactions
// containing the requested metadata label, with JSON values.
MetadataTransactions(
label uint64,
params PaginationParams,
) ([]MetadataTransactionJSONInfo, int, error)
// MetadataTransactionsCBOR returns the paginated transactions
// containing the requested metadata label, with CBOR values.
MetadataTransactionsCBOR(
label uint64,
params PaginationParams,
) ([]MetadataTransactionCBORInfo, int, error)
// Transaction returns summary details for a transaction hash.
Transaction(hash []byte) (TransactionInfo, error)
// TransactionSubmit submits raw signed transaction CBOR to the mempool.
TransactionSubmit(txCbor []byte) (string, error)
// TransactionEvaluate evaluates script execution units for raw transaction
// CBOR without submitting the transaction.
TransactionEvaluate(txCbor []byte) (TransactionEvaluationResponse, error)
// TransactionCBOR returns raw signed transaction CBOR bytes.
TransactionCBOR(hash []byte) ([]byte, error)
// TransactionMetadata returns transaction metadata labels as JSON values.
TransactionMetadata(hash []byte) ([]TransactionMetadataInfo, error)
// TransactionMetadataCBOR returns transaction metadata labels as CBOR values.
TransactionMetadataCBOR(hash []byte) ([]TransactionMetadataCBORInfo, error)
// TransactionUTXOs returns transaction inputs and outputs.
TransactionUTXOs(hash []byte) (TransactionUTXOsInfo, error)
// TransactionDelegations returns delegation certificates in a transaction.
TransactionDelegations(hash []byte) ([]TransactionDelegationInfo, error)
// TransactionStakeAddresses returns stake address certificates in a transaction.
TransactionStakeAddresses(
hash []byte,
) ([]TransactionStakeAddressInfo, error)
// TransactionWithdrawals returns reward withdrawals in a transaction.
TransactionWithdrawals(hash []byte) ([]TransactionWithdrawalInfo, error)
// TransactionMIRs returns MIR certificates in a transaction.
TransactionMIRs(hash []byte) ([]TransactionMIRInfo, error)
// TransactionPoolUpdates returns pool registration certificates in a transaction.
TransactionPoolUpdates(hash []byte) ([]TransactionPoolUpdateInfo, error)
// TransactionPoolRetires returns pool retirement certificates in a transaction.
TransactionPoolRetires(hash []byte) ([]TransactionPoolRetireInfo, error)
// TransactionRedeemers returns Plutus redeemers in a transaction.
TransactionRedeemers(hash []byte) ([]TransactionRedeemerInfo, error)
// TransactionRequiredSigners returns required signing key hashes in a transaction.
TransactionRequiredSigners(
hash []byte,
) ([]TransactionRequiredSignerInfo, error)
// Asset returns native asset information for a
// concatenated hex asset ID ({policy_id}{asset_name}).
Asset(
policyID string,
assetName []byte,
) (AssetInfo, error)
// AssetAddresses returns paginated addresses currently holding the given
// asset, along with the total holder count before pagination.
AssetAddresses(
policyID string,
assetName []byte,
params PaginationParams,
) ([]AssetHolderInfo, int, error)
// DRep returns governance DRep information for a parsed
// DRep credential.
DRep(DRepCredential) (DRepInfo, error)
// DReps returns the paginated DRep list along with the total
// number of matching results before pagination.
DReps(DRepListParams) ([]DRepListItemInfo, int, error)
// Account returns stake-account information for the
// requested stake address.
Account(string) (AccountInfo, error)
// AccountAssociatedAddresses returns payment addresses
// associated with the requested stake address.
AccountAssociatedAddresses(
string,
PaginationParams,
) ([]AccountAssociatedAddressInfo, int, error)
// AccountDelegationHistory returns delegation history
// rows for the requested stake address.
AccountDelegationHistory(
string,
PaginationParams,
) ([]AccountDelegationHistoryInfo, int, error)
// AccountRegistrationHistory returns registration
// history rows for the requested stake address.
AccountRegistrationHistory(
string,
PaginationParams,
) ([]AccountRegistrationHistoryInfo, int, error)
// AccountRewardHistory returns reward history rows for
// the requested stake address.
AccountRewardHistory(
string,
PaginationParams,
) ([]AccountRewardHistoryInfo, int, error)
// AccountUTXOs returns the current UTxOs controlled by the
// stake credential behind the requested stake address.
AccountUTXOs(
string,
PaginationParams,
) ([]AccountUTXOInfo, int, error)
// AccountWithdrawals returns withdrawal history rows for
// the requested stake address.
AccountWithdrawals(
string,
PaginationParams,
) ([]AccountWithdrawalInfo, int, error)
// AccountTransactions returns transactions associated with
// addresses controlled by the stake credential behind the
// requested stake address, optionally filtered by an
// inclusive from/to block-range position.
AccountTransactions(
string,
AccountTransactionsParams,
) ([]AccountTransactionInfo, int, error)
}
BlockfrostNode is the interface that the Blockfrost API server uses to query the node for blockchain data. This decouples the HTTP server from the concrete Node struct and enables testing with mock implementations.
type ChainTipInfo ¶
ChainTipInfo holds chain tip data needed by the API.
type DRepCredential ¶
type DRepCredential struct {
ID string
Hash []byte
HasScript bool
CredentialTagKnown bool
// Predefined is set for the special DReps
// (drep_always_abstain, drep_always_no_confidence), which carry
// no credential hash. The value is a models.DrepType* constant.
Predefined *uint64
}
DRepCredential holds a parsed governance DRep identifier.
type DRepInfo ¶
type DRepInfo struct {
DRepID string
Hex string
Amount string
Active bool
ActiveEpoch *uint64
HasScript bool
Retired bool
Expired bool
LastActiveEpoch *uint64
}
DRepInfo holds DRep data needed by the governance API, following the Blockfrost OpenAPI 0.1.90 drep schema.
type DRepListItemInfo ¶ added in v0.68.0
type DRepListItemInfo struct {
DRepID string
Hex string
Amount string
HasScript bool
Retired bool
Expired bool
LastActiveEpoch *uint64
Metadata *DRepMetadataInfo
}
DRepListItemInfo is one entry of the DRep list endpoint. Unlike DRepInfo it always uses CIP-129 identifiers and carries the resolved anchor metadata.
type DRepListItemResponse ¶ added in v0.68.0
type DRepListItemResponse struct {
DRepID string `json:"drep_id"`
Hex string `json:"hex"`
Amount string `json:"amount"`
HasScript bool `json:"has_script"`
Retired bool `json:"retired"`
Expired bool `json:"expired"`
LastActiveEpoch *uint64 `json:"last_active_epoch"`
Metadata *DRepMetadataResponse `json:"metadata"`
}
DRepListItemResponse is one entry of the Blockfrost DRep list.
type DRepListParams ¶ added in v0.68.0
type DRepListParams struct {
Pagination PaginationParams
OrderByAmount bool
Retired *bool
Expired *bool
}
DRepListParams holds query parameters for the DRep list endpoint.
type DRepMetadataInfo ¶ added in v0.68.0
type DRepMetadataInfo struct {
URL string
Hash string
JSONMetadata json.RawMessage
Bytes string
}
DRepMetadataInfo is the resolved CIP-119 anchor document for a DRep.
type DRepMetadataResponse ¶ added in v0.68.0
type DRepMetadataResponse struct {
URL string `json:"url"`
Hash string `json:"hash"`
JSONMetadata json.RawMessage `json:"json_metadata"`
Bytes string `json:"bytes"`
}
DRepMetadataResponse is the resolved CIP-119 anchor document attached to a DRep list entry.
type DRepResponse ¶
type DRepResponse struct {
DRepID string `json:"drep_id"`
Hex string `json:"hex"`
Amount string `json:"amount"`
Active bool `json:"active"`
ActiveEpoch *uint64 `json:"active_epoch"`
HasScript bool `json:"has_script"`
Retired bool `json:"retired"`
Expired bool `json:"expired"`
LastActiveEpoch *uint64 `json:"last_active_epoch"`
}
DRepResponse represents a Blockfrost governance DRep object (OpenAPI 0.1.90 drep schema; active and active_epoch are deprecated there but remain required).
type EpochInfo ¶
type EpochInfo struct {
Epoch uint64
StartTime int64
EndTime int64
FirstBlockTime int64
LastBlockTime int64
BlockCount int
TxCount int
}
EpochInfo holds epoch data needed by the API.
type EpochResponse ¶
type EpochResponse struct {
Epoch uint64 `json:"epoch"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
FirstBlockTime int64 `json:"first_block_time"`
LastBlockTime int64 `json:"last_block_time"`
BlockCount int `json:"block_count"`
TxCount int `json:"tx_count"`
Output string `json:"output"`
Fees string `json:"fees"`
ActiveStake *string `json:"active_stake"`
}
EpochResponse represents a Blockfrost epoch object.
type ErrorResponse ¶
type ErrorResponse struct {
StatusCode int `json:"status_code"`
Error string `json:"error"`
Message string `json:"message"`
}
ErrorResponse represents a Blockfrost error response.
type ExecutionUnitsResponse ¶ added in v0.70.2
ExecutionUnitsResponse contains the execution units consumed by a redeemer.
type GenesisInfo ¶
type GenesisInfo struct {
ActiveSlotsCoefficient float32
UpdateQuorum int
MaxLovelaceSupply string
NetworkMagic int
EpochLength int
SystemStart int
SlotsPerKESPeriod int
SlotLength int
MaxKESEvolutions int
SecurityParam int
}
GenesisInfo holds Shelley genesis configuration values.
type GenesisResponse ¶
type GenesisResponse 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"`
}
GenesisResponse represents Blockfrost genesis info.
type HealthResponse ¶
type HealthResponse struct {
IsHealthy bool `json:"is_healthy"`
}
HealthResponse is returned by GET /health.
type MetadataTransactionCBORInfo ¶
MetadataTransactionCBORInfo holds metadata label query data for the CBOR endpoint.
type MetadataTransactionCBORResponse ¶
type MetadataTransactionCBORResponse struct {
TxHash string `json:"tx_hash"`
CborMetadata *string `json:"cbor_metadata"`
Metadata string `json:"metadata"`
}
MetadataTransactionCBORResponse represents a Blockfrost metadata label transaction item with CBOR content.
type MetadataTransactionJSONInfo ¶
type MetadataTransactionJSONInfo struct {
TxHash string
JSONMetadata json.RawMessage
}
MetadataTransactionJSONInfo holds metadata label query data for the JSON endpoint.
type MetadataTransactionJSONResponse ¶
type MetadataTransactionJSONResponse struct {
TxHash string `json:"tx_hash"`
JSONMetadata json.RawMessage `json:"json_metadata"`
}
MetadataTransactionJSONResponse represents a Blockfrost metadata label transaction item with JSON content.
type NetworkEraBound ¶
type NetworkEraBound struct {
Time int64 `json:"time"`
Slot uint64 `json:"slot"`
Epoch uint64 `json:"epoch"`
}
NetworkEraBound represents an era boundary.
type NetworkEraBoundInfo ¶
NetworkEraBoundInfo holds an era boundary.
type NetworkEraInfo ¶
type NetworkEraInfo struct {
Era string
Start NetworkEraBoundInfo
End *NetworkEraBoundInfo
Params NetworkEraParamsInfo
}
NetworkEraInfo holds a Blockfrost hard-fork era summary.
type NetworkEraParameters ¶
type NetworkEraParameters struct {
EpochLength uint64 `json:"epoch_length"`
SlotLength uint64 `json:"slot_length"`
SafeZone uint64 `json:"safe_zone"`
}
NetworkEraParameters represents era timing parameters.
type NetworkEraParamsInfo ¶
NetworkEraParamsInfo holds era timing parameters.
type NetworkEraResponse ¶
type NetworkEraResponse struct {
Start NetworkEraBound `json:"start"`
End *NetworkEraBound `json:"end"`
Parameters NetworkEraParameters `json:"parameters"`
}
NetworkEraResponse represents a Blockfrost era summary. Per Blockfrost OpenAPI 0.1.88 (schema network-eras) each item carries only start, end, and parameters; the human-readable era name is intentionally omitted to keep the response shape compatible with the published schema.
type NetworkInfo ¶
type NetworkInfo struct {
Supply NetworkSupplyInfo
Stake NetworkStakeInfo
}
NetworkInfo holds network supply and stake data needed by the API.
type NetworkResponse ¶
type NetworkResponse struct {
Supply NetworkSupply `json:"supply"`
Stake NetworkStake `json:"stake"`
}
NetworkResponse represents Blockfrost network info.
type NetworkStake ¶
NetworkStake holds stake information.
type NetworkStakeInfo ¶
NetworkStakeInfo holds network stake data needed by the API.
type NetworkSupply ¶
type NetworkSupply struct {
Max string `json:"max"`
Total string `json:"total"`
Circulating string `json:"circulating"`
Locked string `json:"locked"`
Treasury string `json:"treasury"`
Reserves string `json:"reserves"`
}
NetworkSupply holds supply information.
type NetworkSupplyInfo ¶
type NetworkSupplyInfo struct {
Max string
Total string
Circulating string
Locked string
Treasury string
Reserves string
}
NetworkSupplyInfo holds network supply data needed by the API.
type NodeAdapter ¶
type NodeAdapter struct {
// contains filtered or unexported fields
}
NodeAdapter wraps a real dingo Node's LedgerState to implement the BlockfrostNode interface.
func NewNodeAdapter ¶
func NewNodeAdapter( ls *ledger.LedgerState, submitter TransactionSubmitter, ) (*NodeAdapter, error)
NewNodeAdapter creates a NodeAdapter that queries the given LedgerState for blockchain data.
func (*NodeAdapter) Account ¶
func (a *NodeAdapter) Account( stakeAddress string, ) (AccountInfo, error)
Account returns stake-account information for the requested stake address.
func (*NodeAdapter) AccountAssociatedAddresses ¶
func (a *NodeAdapter) AccountAssociatedAddresses( stakeAddress string, params PaginationParams, ) ([]AccountAssociatedAddressInfo, int, error)
AccountAssociatedAddresses returns payment addresses associated with the requested stake address.
func (*NodeAdapter) AccountDelegationHistory ¶
func (a *NodeAdapter) AccountDelegationHistory( stakeAddress string, params PaginationParams, ) ([]AccountDelegationHistoryInfo, int, error)
AccountDelegationHistory returns delegation history rows for the requested stake address.
func (*NodeAdapter) AccountRegistrationHistory ¶
func (a *NodeAdapter) AccountRegistrationHistory( stakeAddress string, params PaginationParams, ) ([]AccountRegistrationHistoryInfo, int, error)
AccountRegistrationHistory returns registration history rows for the requested stake address.
func (*NodeAdapter) AccountRewardHistory ¶
func (a *NodeAdapter) AccountRewardHistory( stakeAddress string, params PaginationParams, ) ([]AccountRewardHistoryInfo, int, error)
AccountRewardHistory returns reward history rows for the requested stake address.
func (*NodeAdapter) AccountTransactions ¶ added in v0.69.0
func (a *NodeAdapter) AccountTransactions( stakeAddress string, params AccountTransactionsParams, ) ([]AccountTransactionInfo, int, error)
AccountTransactions returns transactions associated with addresses controlled by the stake credential behind stakeAddress, optionally filtered by an inclusive from/to block-range position.
Every step here is bounded by the requested page size, not by the credential's full transaction history: the (payment address, transaction) association rows are paginated in SQL against address_transaction (which already carries slot/tx_index, so the from/to range is a SQL predicate, not an in-memory filter), and the payment-credential script/key bit and block height/time are then resolved only for the <= count rows on the page.
func (*NodeAdapter) AccountUTXOs ¶ added in v0.69.0
func (a *NodeAdapter) AccountUTXOs( stakeAddress string, params PaginationParams, ) ([]AccountUTXOInfo, int, error)
AccountUTXOs returns the current UTxOs controlled by the stake credential behind stakeAddress. It models NodeAdapter.AddressUTXOs, reusing the same CBOR-derived datum/reference-script recovery so the fields stay consistent with /addresses/{address}/utxos and /txs/{hash}/utxos. Unlike a single-address query, each row's address must be recovered per-UTxO from decoded output CBOR, because a stake credential can be shared by many distinct payment addresses.
func (*NodeAdapter) AccountWithdrawals ¶ added in v0.69.0
func (a *NodeAdapter) AccountWithdrawals( stakeAddress string, params PaginationParams, ) ([]AccountWithdrawalInfo, int, error)
AccountWithdrawals returns withdrawal history rows for the stake credential behind stakeAddress.
func (*NodeAdapter) Address ¶ added in v0.68.0
func (a *NodeAdapter) Address( address string, ) (AddressInfo, error)
Address returns summary details for the requested address, with balances aggregated across its live UTxOs. Addresses never seen on chain map to ErrAddressNotFound; addresses with spent history resolve with a zero lovelace balance.
func (*NodeAdapter) AddressTransactions ¶
func (a *NodeAdapter) AddressTransactions( address string, params PaginationParams, ) ([]AddressTransactionInfo, int, error)
AddressTransactions returns paginated transaction history for the requested address.
func (*NodeAdapter) AddressUTXOs ¶
func (a *NodeAdapter) AddressUTXOs( address string, params PaginationParams, ) ([]AddressUTXOInfo, int, error)
func (*NodeAdapter) Asset ¶
func (a *NodeAdapter) Asset( policyID string, assetName []byte, ) (AssetInfo, error)
Asset returns native asset information for a policy ID and raw asset name bytes.
func (*NodeAdapter) AssetAddresses ¶ added in v0.62.0
func (a *NodeAdapter) AssetAddresses( policyID string, assetName []byte, params PaginationParams, ) ([]AssetHolderInfo, int, error)
AssetAddresses returns paginated addresses currently holding the given asset.
func (*NodeAdapter) BlockByHashOrNumber ¶
func (a *NodeAdapter) BlockByHashOrNumber( id string, ) (BlockInfo, error)
BlockByHashOrNumber returns block information by hash or height.
func (*NodeAdapter) ChainTip ¶
func (a *NodeAdapter) ChainTip() ( ChainTipInfo, error, )
ChainTip returns the current chain tip from the ledger state.
func (*NodeAdapter) CurrentEpoch ¶
func (a *NodeAdapter) CurrentEpoch() ( EpochInfo, error, )
CurrentEpoch returns information about the current epoch.
func (*NodeAdapter) CurrentProtocolParams ¶
func (a *NodeAdapter) CurrentProtocolParams() ( ProtocolParamsInfo, error, )
CurrentProtocolParams returns the current protocol parameters.
func (*NodeAdapter) DRep ¶
func (a *NodeAdapter) DRep( credential DRepCredential, ) (DRepInfo, error)
DRep returns governance DRep information for the requested credential.
func (*NodeAdapter) DReps ¶ added in v0.68.0
func (a *NodeAdapter) DReps( params DRepListParams, ) ([]DRepListItemInfo, int, error)
DReps returns the paginated DRep list. Default ordering follows the credential's first on-chain appearance; order_by=amount sorts by delegated voting power with appearance order as the tie-break. The special always-abstain / always-no-confidence DReps are interleaved at the position of their first delegation, matching hosted Blockfrost.
func (*NodeAdapter) EpochProtocolParams ¶
func (a *NodeAdapter) EpochProtocolParams( epoch uint64, ) (ProtocolParamsInfo, error)
EpochProtocolParams returns protocol parameters for the requested epoch.
func (*NodeAdapter) Genesis ¶
func (a *NodeAdapter) Genesis() (GenesisInfo, error)
Genesis returns Shelley genesis configuration values.
func (*NodeAdapter) LatestBlock ¶
func (a *NodeAdapter) LatestBlock() ( BlockInfo, error, )
LatestBlock returns information about the latest block.
func (*NodeAdapter) LatestBlockTxHashes ¶
func (a *NodeAdapter) LatestBlockTxHashes() ( []string, error, )
LatestBlockTxHashes returns transaction hashes from the latest block.
func (*NodeAdapter) MetadataTransactions ¶
func (a *NodeAdapter) MetadataTransactions( label uint64, params PaginationParams, ) ([]MetadataTransactionJSONInfo, int, error)
MetadataTransactions returns paginated transaction metadata values for the requested label in JSON form.
func (*NodeAdapter) MetadataTransactionsCBOR ¶
func (a *NodeAdapter) MetadataTransactionsCBOR( label uint64, params PaginationParams, ) ([]MetadataTransactionCBORInfo, int, error)
MetadataTransactionsCBOR returns paginated transaction metadata values for the requested label in CBOR-hex form.
func (*NodeAdapter) Network ¶
func (a *NodeAdapter) Network() (NetworkInfo, error)
Network returns current network supply and stake information.
func (*NodeAdapter) NetworkEras ¶
func (a *NodeAdapter) NetworkEras() ([]NetworkEraInfo, error)
NetworkEras returns hard-fork era summaries.
func (*NodeAdapter) PoolDetail ¶ added in v0.69.0
func (a *NodeAdapter) PoolDetail(poolID string) (PoolDetailInfo, error)
PoolDetail returns the OpenAPI pool detail object for the requested pool (bech32 or hex ID). Epoch-sensitive aggregates (active stake, saturation, blocks_epoch) are computed for the current epoch.
func (*NodeAdapter) PoolMetadata ¶ added in v0.69.0
func (a *NodeAdapter) PoolMetadata( poolID string, ) (PoolMetadataInfo, error)
PoolMetadata returns the registered metadata for the requested pool: the on-chain anchor from the latest registration plus the off-chain document fields when the cached fetch succeeded.
func (*NodeAdapter) PoolsExtended ¶
func (a *NodeAdapter) PoolsExtended() ( []PoolExtendedInfo, error, )
PoolsExtended returns the current active pools with the fields required by the Blockfrost OpenAPI 0.1.90 pool_list_extended schema (active/live stake, blocks_minted, live_saturation, margin/pledge/cost, and the nullable off-chain metadata object). Pagination and ordering are applied by the caller (handlePoolsExtended); this returns every active pool.
func (*NodeAdapter) PoolsList ¶ added in v0.69.0
func (a *NodeAdapter) PoolsList( params PaginationParams, ) ([]string, int, error)
PoolsList returns the paginated list of currently registered (active, non-retired) stake pool IDs, along with the total number of matching results before pagination.
Ordering: the store query (GetActivePoolKeyHashesOrdered) returns every active pool key hash already sorted oldest-first by each pool's FIRST on-chain registration certificate -- not its most recent one -- which is the chain-derived order the pool_list schema's "oldest first, newest last" wording calls for (see poolorder.GetActivePoolKeyHashesOrdered's doc comment for the full rationale, including why this is a deliberate, reversible semantic choice rather than one the schema pins). asc uses that order as-is; desc reverses the same slice, so the two are exact reverses of each other by construction rather than by two independently-sorted queries agreeing. This ordering and the active/retired determination are verified identical across sqlite, postgres, and mysql against the same 8-pool fixture: see TestNodeAdapterPoolsListOrderingAndActiveSet (pools_list_test.go) and its direct-store postgres/mysql counterparts (database/plugin/metadata/{postgres,mysql}/pool_active_ordered_test.go).
Query cost: the result is one row per active pool (~3,000 on mainnet), the same result-set shape PoolsExtended already reads via GetActivePoolKeyHashes/GetActivePoolKeyHashesAtSlot; no per-page query is added. The underlying scan cost is bounded by the total historical pool_registration row count instead (verified via EXPLAIN on all three backends, see DATABASE.md), since the added_slot filter can't use the (pool_id, added_slot) index on any backend -- the same bound GetActivePoolKeyHashesAtSlot already pays for PoolsExtended. Pagination is applied in memory (slice), matching PoolsRetiring (GetRetiringPools + PoolsRetiring) rather than pushing LIMIT/OFFSET into SQL: the ORDER BY here is derived from a per-pool window-function ranking computed across the full registration/retirement history, so the whole active set must be ranked before any page boundary can be determined -- a SQL-side LIMIT/OFFSET would trim rows only after that ranking work is done, and would not reduce it. The response is bare pool ID strings, so slicing the resulting hash slice in memory before conversion is cheap relative to that query.
func (*NodeAdapter) PoolsRetiring ¶ added in v0.69.0
func (a *NodeAdapter) PoolsRetiring( params PaginationParams, ) ([]PoolRetiringInfo, int, error)
PoolsRetiring returns the paginated list of pools with a pending retirement: a retirement certificate for a future epoch that has not been cancelled by a later re-registration. Entries are ordered by retirement epoch and then announcement position, matching hosted Blockfrost.
func (*NodeAdapter) Transaction ¶
func (a *NodeAdapter) Transaction( hash []byte, ) (TransactionInfo, error)
Transaction returns summary details for the requested transaction.
func (*NodeAdapter) TransactionCBOR ¶
func (a *NodeAdapter) TransactionCBOR( hash []byte, ) ([]byte, error)
TransactionCBOR returns raw signed transaction CBOR bytes for the requested transaction hash.
func (*NodeAdapter) TransactionDelegations ¶
func (a *NodeAdapter) TransactionDelegations( hash []byte, ) ([]TransactionDelegationInfo, error)
TransactionDelegations returns delegation certificates in the requested transaction.
func (*NodeAdapter) TransactionEvaluate ¶ added in v0.70.2
func (a *NodeAdapter) TransactionEvaluate( txCbor []byte, ) (TransactionEvaluationResponse, error)
TransactionEvaluate evaluates script execution units for raw transaction CBOR without submitting the transaction.
func (*NodeAdapter) TransactionMIRs ¶
func (a *NodeAdapter) TransactionMIRs( hash []byte, ) ([]TransactionMIRInfo, error)
TransactionMIRs returns MIR certificate reward targets in the requested transaction.
func (*NodeAdapter) TransactionMetadata ¶
func (a *NodeAdapter) TransactionMetadata( hash []byte, ) ([]TransactionMetadataInfo, error)
TransactionMetadata returns metadata labels for the requested transaction as JSON values.
func (*NodeAdapter) TransactionMetadataCBOR ¶
func (a *NodeAdapter) TransactionMetadataCBOR( hash []byte, ) ([]TransactionMetadataCBORInfo, error)
TransactionMetadataCBOR returns metadata labels for the requested transaction as CBOR hex values.
func (*NodeAdapter) TransactionPoolRetires ¶
func (a *NodeAdapter) TransactionPoolRetires( hash []byte, ) ([]TransactionPoolRetireInfo, error)
TransactionPoolRetires returns pool retirement certificates in the requested transaction.
func (*NodeAdapter) TransactionPoolUpdates ¶
func (a *NodeAdapter) TransactionPoolUpdates( hash []byte, ) ([]TransactionPoolUpdateInfo, error)
TransactionPoolUpdates returns pool registration certificates in the requested transaction.
func (*NodeAdapter) TransactionRedeemers ¶
func (a *NodeAdapter) TransactionRedeemers( hash []byte, ) ([]TransactionRedeemerInfo, error)
TransactionRedeemers returns Plutus redeemers stored for the requested transaction.
func (*NodeAdapter) TransactionRequiredSigners ¶
func (a *NodeAdapter) TransactionRequiredSigners( hash []byte, ) ([]TransactionRequiredSignerInfo, error)
TransactionRequiredSigners returns the required signers (extra signing key hashes) declared in the requested transaction.
func (*NodeAdapter) TransactionStakeAddresses ¶
func (a *NodeAdapter) TransactionStakeAddresses( hash []byte, ) ([]TransactionStakeAddressInfo, error)
TransactionStakeAddresses returns stake registration/deregistration certificates in the requested transaction.
func (*NodeAdapter) TransactionSubmit ¶
func (a *NodeAdapter) TransactionSubmit( txCbor []byte, ) (string, error)
TransactionSubmit submits raw signed transaction CBOR to the mempool.
func (*NodeAdapter) TransactionUTXOs ¶
func (a *NodeAdapter) TransactionUTXOs( hash []byte, ) (TransactionUTXOsInfo, error)
TransactionUTXOs returns inputs and outputs for the requested transaction.
func (*NodeAdapter) TransactionWithdrawals ¶
func (a *NodeAdapter) TransactionWithdrawals( hash []byte, ) ([]TransactionWithdrawalInfo, error)
TransactionWithdrawals returns reward withdrawals in the requested transaction.
type OffchainFetchErrorInfo ¶ added in v0.69.0
OffchainFetchErrorInfo describes a failed off-chain metadata fetch in Blockfrost's error-object form.
type OffchainFetchErrorResponse ¶ added in v0.69.0
type OffchainFetchErrorResponse struct {
Code string `json:"code"`
Message string `json:"message"`
}
OffchainFetchErrorResponse is the Blockfrost error object attached to metadata whose off-chain document fetch failed.
type PaginationParams ¶
PaginationParams contains parsed pagination query values.
func ParsePagination ¶
func ParsePagination(r *http.Request) (PaginationParams, error)
ParsePagination parses pagination query parameters and applies defaults and bounds clamping.
func ParsePaginationStrict ¶ added in v0.68.0
func ParsePaginationStrict(r *http.Request) (PaginationParams, string)
ParsePaginationStrict parses pagination query parameters with Blockfrost-compatible validation: out-of-range values are rejected with the hosted API's exact fastify error message instead of being clamped. The second return value is the error message, empty when parsing succeeded.
type PoolCalidusKeyInfo ¶ added in v0.69.0
type PoolCalidusKeyInfo struct {
ID string
PubKey string
Nonce uint64
TxHash string
BlockHeight uint64
BlockTime int64
Epoch uint64
}
PoolCalidusKeyInfo holds a pool's latest valid CIP-0088 Calidus key registration (Blockfrost's calidus_key object). dingo does not currently ingest Calidus key registrations from any source, so every BlockfrostNode implementation returns a nil *PoolCalidusKeyInfo here; the type exists so PoolDetailInfo mirrors the OpenAPI schema exactly.
type PoolCalidusKeyResponse ¶ added in v0.69.0
type PoolCalidusKeyResponse struct {
ID string `json:"id"`
PubKey string `json:"pub_key"`
Nonce uint64 `json:"nonce"`
TxHash string `json:"tx_hash"`
BlockHeight uint64 `json:"block_height"`
BlockTime int64 `json:"block_time"`
Epoch uint64 `json:"epoch"`
}
PoolCalidusKeyResponse represents a pool's latest valid CIP-0088 Calidus key registration. dingo does not ingest Calidus key registrations from any source, so this field is always null in responses.
type PoolDetailInfo ¶ added in v0.69.0
type PoolDetailInfo struct {
PoolID string
Hex string
VrfKey string
LiveStake string
ActiveStake string
DeclaredPledge string
LivePledge string
FixedCost string
RewardAccount string
Owners []string
// Registration and Retirement are the transaction hashes of the pool's
// registration and retirement certificates, oldest first. Certificates
// with no linked transaction (rows synthesized by a Mithril
// ledger-state import) are excluded since they have no originating
// transaction to report.
Registration []string
Retirement []string
CalidusKey *PoolCalidusKeyInfo
BlocksMinted uint64
BlocksEpoch uint64
LiveDelegators uint64
LiveSize float64
LiveSaturation float64
ActiveSize float64
MarginCost float64
}
PoolDetailInfo holds pool data needed by the /pools/{pool_id} endpoint, following the Blockfrost OpenAPI 0.1.90 pool schema.
type PoolDetailResponse ¶ added in v0.69.0
type PoolDetailResponse struct {
PoolID string `json:"pool_id"`
Hex string `json:"hex"`
VrfKey string `json:"vrf_key"`
BlocksMinted uint64 `json:"blocks_minted"`
BlocksEpoch uint64 `json:"blocks_epoch"`
LiveStake string `json:"live_stake"`
LiveSize float64 `json:"live_size"`
LiveSaturation float64 `json:"live_saturation"`
LiveDelegators uint64 `json:"live_delegators"`
ActiveStake string `json:"active_stake"`
ActiveSize float64 `json:"active_size"`
DeclaredPledge string `json:"declared_pledge"`
LivePledge string `json:"live_pledge"`
MarginCost float64 `json:"margin_cost"`
FixedCost string `json:"fixed_cost"`
RewardAccount string `json:"reward_account"`
Owners []string `json:"owners"`
Registration []string `json:"registration"`
Retirement []string `json:"retirement"`
CalidusKey *PoolCalidusKeyResponse `json:"calidus_key"`
}
PoolDetailResponse represents a Blockfrost pool detail object (OpenAPI 0.1.90 pool schema).
type PoolExtendedInfo ¶
type PoolExtendedInfo struct {
PoolID string
Hex string
ActiveStake string
LiveStake string
BlocksMinted uint64
LiveSaturation float64
DeclaredPledge string
MarginCost float64
FixedCost string
Metadata *PoolExtendedMetadataInfo
}
PoolExtendedInfo holds pool data needed by the /pools/extended endpoint, following the Blockfrost OpenAPI 0.1.90 pool_list_extended schema. Neither vrf_key nor relays is part of that schema (vrf_key belongs to the pool-detail schema instead; see PoolDetailInfo), so this type omits both.
type PoolExtendedMetadataInfo ¶ added in v0.69.0
type PoolExtendedMetadataInfo struct {
URL *string
Hash *string
Ticker *string
Name *string
Description *string
Homepage *string
Error *OffchainFetchErrorInfo
}
PoolExtendedMetadataInfo holds the nullable metadata object nested in pool_list_extended: the on-chain anchor (URL/hash) plus the off-chain document fields when fetched and validated, or Error when the fetch or validation failed. A nil *PoolExtendedMetadataInfo means the pool has no registered metadata anchor at all (metadata: null); this mirrors PoolMetadataInfo's fields but omits PoolID/Hex, which pool_list_extended carries at the parent object level instead of inside metadata.
type PoolExtendedMetadataResponse ¶ added in v0.69.0
type PoolExtendedMetadataResponse struct {
URL *string `json:"url"`
Hash *string `json:"hash"`
Ticker *string `json:"ticker"`
Name *string `json:"name"`
Description *string `json:"description"`
Homepage *string `json:"homepage"`
Error *OffchainFetchErrorResponse `json:"error,omitempty"`
}
PoolExtendedMetadataResponse represents pool_list_extended's nullable metadata object. It mirrors PoolMetadataResponse's off-chain fields (minus pool_id/hex, which pool_list_extended carries at the parent level) and is omitted (metadata: null) entirely when the pool has no registered metadata anchor.
type PoolExtendedResponse ¶
type PoolExtendedResponse struct {
PoolID string `json:"pool_id"`
Hex string `json:"hex"`
ActiveStake string `json:"active_stake"`
LiveStake string `json:"live_stake"`
BlocksMinted uint64 `json:"blocks_minted"`
LiveSaturation float64 `json:"live_saturation"`
DeclaredPledge string `json:"declared_pledge"`
MarginCost float64 `json:"margin_cost"`
FixedCost string `json:"fixed_cost"`
Metadata *PoolExtendedMetadataResponse `json:"metadata"`
}
PoolExtendedResponse represents an extended stake pool list item, following the Blockfrost OpenAPI 0.1.90 pool_list_extended schema exactly. Neither vrf_key nor relays is part of that schema (vrf_key belongs to the pool-detail schema instead; see PoolDetailResponse), so this type omits both.
type PoolMetadataInfo ¶ added in v0.69.0
type PoolMetadataInfo struct {
PoolID string
Hex string
URL *string
Hash *string
Ticker *string
Name *string
Description *string
Homepage *string
Error *OffchainFetchErrorInfo
}
PoolMetadataInfo holds a pool's registered metadata: the on-chain anchor (URL and hash) plus the off-chain document fields when the document has been fetched and validated. Error carries the fetch failure when the document could not be retrieved or validated.
type PoolMetadataResponse ¶ added in v0.69.0
type PoolMetadataResponse struct {
PoolID string `json:"pool_id"`
Hex string `json:"hex"`
URL *string `json:"url"`
Hash *string `json:"hash"`
Ticker *string `json:"ticker"`
Name *string `json:"name"`
Description *string `json:"description"`
Homepage *string `json:"homepage"`
Error *OffchainFetchErrorResponse `json:"error,omitempty"`
}
PoolMetadataResponse represents Blockfrost pool metadata. The error object is only present when the off-chain document fetch failed.
type PoolRetiringInfo ¶ added in v0.69.0
PoolRetiringInfo is one entry of the retiring pools list.
type PoolRetiringResponse ¶ added in v0.69.0
PoolRetiringResponse is one entry of the Blockfrost retiring pools list.
type ProtocolParamsInfo ¶
type ProtocolParamsInfo struct {
Epoch uint64
MinFeeA int
MinFeeB int
MaxBlockSize int
MaxTxSize int
MaxBlockHeaderSize int
KeyDeposit string
PoolDeposit string
EMax int
NOpt int
A0 float64
Rho float64
Tau float64
ProtocolMajorVer int
ProtocolMinorVer int
MinPoolCost string
CoinsPerUtxoSize string
PriceMem float64
PriceStep float64
MaxTxExMem string
MaxTxExSteps string
MaxBlockExMem string
MaxBlockExSteps string
MaxValSize string
CollateralPercent int
MaxCollateralInputs int
// Conway-era governance and reference-script parameters. These are nil
// for pre-Conway eras where they do not apply.
PvtMotionNoConfidence *float64
PvtCommitteeNormal *float64
PvtCommitteeNoConfidence *float64
PvtHardForkInitiation *float64
PvtPPSecurityGroup *float64
DvtMotionNoConfidence *float64
DvtCommitteeNormal *float64
DvtCommitteeNoConfidence *float64
DvtUpdateToConstitution *float64
DvtHardForkInitiation *float64
DvtPPNetworkGroup *float64
DvtPPEconomicGroup *float64
DvtPPTechnicalGroup *float64
DvtPPGovGroup *float64
DvtTreasuryWithdrawal *float64
CommitteeMinSize *string
CommitteeMaxTermLength *string
GovActionLifetime *string
GovActionDeposit *string
DRepDeposit *string
DRepActivity *string
MinFeeRefScriptCostPerByte *float64
// CostModelsRaw holds cost models keyed by Plutus version name with raw
// integer arrays, matching the Blockfrost cost_models_raw field. nil
// when the era carries no cost models.
CostModelsRaw *any
}
ProtocolParamsInfo holds protocol parameter data needed by the API.
type ProtocolParamsResponse ¶
type ProtocolParamsResponse struct {
Epoch uint64 `json:"epoch"`
MinFeeA int `json:"min_fee_a"`
MinFeeB int `json:"min_fee_b"`
MaxBlockSize int `json:"max_block_size"`
MaxTxSize int `json:"max_tx_size"`
MaxBlockHeaderSize int `json:"max_block_header_size"`
KeyDeposit string `json:"key_deposit"`
PoolDeposit string `json:"pool_deposit"`
EMax int `json:"e_max"`
NOpt int `json:"n_opt"`
A0 float64 `json:"a0"`
Rho float64 `json:"rho"`
Tau float64 `json:"tau"`
//nolint:tagliatelle
DecentralisationParam float64 `json:"decentralisation_param"`
ExtraEntropy *map[string]any `json:"extra_entropy"`
ProtocolMajorVer int `json:"protocol_major_ver"`
ProtocolMinorVer int `json:"protocol_minor_ver"`
MinUtxo string `json:"min_utxo"`
MinPoolCost string `json:"min_pool_cost"`
Nonce string `json:"nonce"`
CoinsPerUtxoSize *string `json:"coins_per_utxo_size"`
CoinsPerUtxoWord string `json:"coins_per_utxo_word"`
CostModels *any `json:"cost_models"`
PriceMem *float64 `json:"price_mem"`
PriceStep *float64 `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"`
MaxCollateralInputs *int `json:"max_collateral_inputs"`
// Conway-era governance and reference-script parameters. These are
// null for pre-Conway eras where they do not apply.
PvtMotionNoConfidence *float64 `json:"pvt_motion_no_confidence"`
PvtCommitteeNormal *float64 `json:"pvt_committee_normal"`
PvtCommitteeNoConfidence *float64 `json:"pvt_committee_no_confidence"`
PvtHardForkInitiation *float64 `json:"pvt_hard_fork_initiation"`
DvtMotionNoConfidence *float64 `json:"dvt_motion_no_confidence"`
DvtCommitteeNormal *float64 `json:"dvt_committee_normal"`
DvtCommitteeNoConfidence *float64 `json:"dvt_committee_no_confidence"`
DvtUpdateToConstitution *float64 `json:"dvt_update_to_constitution"`
DvtHardForkInitiation *float64 `json:"dvt_hard_fork_initiation"`
//nolint:tagliatelle
DvtPPNetworkGroup *float64 `json:"dvt_p_p_network_group"`
//nolint:tagliatelle
DvtPPEconomicGroup *float64 `json:"dvt_p_p_economic_group"`
//nolint:tagliatelle
DvtPPTechnicalGroup *float64 `json:"dvt_p_p_technical_group"`
//nolint:tagliatelle
DvtPPGovGroup *float64 `json:"dvt_p_p_gov_group"`
DvtTreasuryWithdrawal *float64 `json:"dvt_treasury_withdrawal"`
CommitteeMinSize *string `json:"committee_min_size"`
CommitteeMaxTermLength *string `json:"committee_max_term_length"`
GovActionLifetime *string `json:"gov_action_lifetime"`
GovActionDeposit *string `json:"gov_action_deposit"`
DrepDeposit *string `json:"drep_deposit"`
DrepActivity *string `json:"drep_activity"`
PvtppSecurityGroup *float64 `json:"pvtpp_security_group"`
//nolint:tagliatelle
PvtPPSecurityGroup *float64 `json:"pvt_p_p_security_group"`
MinFeeRefScriptCostPerByte *float64 `json:"min_fee_ref_script_cost_per_byte"`
CostModelsRaw *any `json:"cost_models_raw"`
}
ProtocolParamsResponse represents Blockfrost protocol parameters.
type ProviderConfig ¶ added in v0.68.0
type ProviderConfig struct {
Port uint `yaml:"port"`
TLS apiconfig.TLSPolicy `yaml:"tls"`
Auth apiconfig.AuthPolicy `yaml:"auth"`
}
ProviderConfig's TLS and Auth fields are documented in ARCHITECTURE.md's "API security" section. Composition (node.go) merges the top-level api.tls/api.auth defaults into these fields before this provider ever decodes them, so from this package's point of view they are always already-resolved-for-this-provider settings, identical in shape to a provider that set every field inline.
type ProviderDependencies ¶ added in v0.68.0
type ProviderDependencies struct {
Node BlockfrostNode
Logger *slog.Logger
Host string
CORSAllowedOrigins []string
}
type RootResponse ¶
RootResponse is returned by GET /.
type TransactionCBORResponse ¶
type TransactionCBORResponse struct {
CBOR string `json:"cbor"`
}
TransactionCBORResponse represents transaction CBOR in hex form.
type TransactionDelegationInfo ¶
type TransactionDelegationInfo struct {
Address string
PoolID string
Index int
CertIndex int
ActiveEpoch uint64
}
TransactionDelegationInfo holds one delegation certificate.
type TransactionDelegationResponse ¶
type TransactionDelegationResponse struct {
Address string `json:"address"`
PoolID string `json:"pool_id"`
Index int `json:"index"`
CertIndex int `json:"cert_index"`
ActiveEpoch uint64 `json:"active_epoch"`
}
TransactionDelegationResponse represents one delegation certificate.
type TransactionEvaluationEnvelope ¶ added in v0.70.3
type TransactionEvaluationEnvelope struct {
Type string `json:"type"`
Version string `json:"version"`
ServiceName string `json:"servicename"`
MethodName string `json:"methodname"`
Result TransactionEvaluationResult `json:"result"`
Reflection any `json:"reflection"`
}
TransactionEvaluationEnvelope is the response body both evaluation endpoints return: the Ogmios v5 EvaluateTx response that Blockfrost passes through verbatim. Off-chain SDKs read the execution units from result.EvaluationResult, so the envelope is part of the wire contract rather than decoration.
type TransactionEvaluationResponse ¶ added in v0.70.2
type TransactionEvaluationResponse map[string]ExecutionUnitsResponse
TransactionEvaluationResponse contains the execution units calculated for each redeemer in a transaction. Keys use redeemer pointers such as "spend:0" and "mint:0".
type TransactionEvaluationResult ¶ added in v0.70.3
type TransactionEvaluationResult struct {
EvaluationResult TransactionEvaluationResponse `json:"EvaluationResult"`
}
TransactionEvaluationResult holds the execution units of a successful evaluation under the key Ogmios uses for them.
type TransactionInfo ¶
type TransactionInfo struct {
InvalidBefore *string
InvalidHereafter *string
OutputAmount []AddressAmountInfo
Hash string
Block string
Deposit string
Fees string
TreasuryDonation string
Slot uint64
BlockHeight uint64
BlockTime int64
Size int
Index uint32
UtxoCount int
WithdrawalCount int
MirCertCount int
DelegationCount int
StakeCertCount int
PoolUpdateCount int
PoolRetireCount int
AssetMintBurnCount int
RedeemerCount int
ValidContract bool
}
TransactionInfo holds transaction summary data needed by the API.
type TransactionInputInfo ¶
type TransactionInputInfo struct {
ReferenceScriptHash *string
InlineDatum *string
DataHash *string
Address string
TxHash string
Amount []AddressAmountInfo
OutputIndex uint32
Collateral bool
Reference *bool
}
TransactionInputInfo holds one transaction input.
type TransactionInputResponse ¶
type TransactionInputResponse struct {
ReferenceScriptHash *string `json:"reference_script_hash"`
InlineDatum *string `json:"inline_datum"`
DataHash *string `json:"data_hash"`
Reference *bool `json:"reference"`
Address string `json:"address"`
TxHash string `json:"tx_hash"`
Amount []AddressAmountResponse `json:"amount"`
OutputIndex int `json:"output_index"`
Collateral bool `json:"collateral"`
}
TransactionInputResponse represents one transaction input.
type TransactionMIRInfo ¶
TransactionMIRInfo holds one MIR target.
type TransactionMIRResponse ¶
type TransactionMIRResponse struct {
Address string `json:"address"`
Amount string `json:"amount"`
CertIndex int `json:"cert_index"`
Pot string `json:"pot"`
}
TransactionMIRResponse represents one MIR certificate target.
type TransactionMetadataCBORInfo ¶
TransactionMetadataCBORInfo holds a transaction metadata label and CBOR value.
type TransactionMetadataCBORResponse ¶
type TransactionMetadataCBORResponse struct {
CborMetadata *string `json:"cbor_metadata"`
Metadata string `json:"metadata"`
Label string `json:"label"`
}
TransactionMetadataCBORResponse represents one transaction metadata label in CBOR form.
type TransactionMetadataInfo ¶
type TransactionMetadataInfo struct {
JSONMetadata json.RawMessage
Label string
}
TransactionMetadataInfo holds a transaction metadata label and JSON value.
type TransactionMetadataResponse ¶
type TransactionMetadataResponse struct {
JSONMetadata json.RawMessage `json:"json_metadata"`
Label string `json:"label"`
}
TransactionMetadataResponse represents one transaction metadata label in JSON form.
type TransactionOutputInfo ¶
type TransactionOutputInfo struct {
ReferenceScriptHash *string
InlineDatum *string
DataHash *string
ConsumedByTx *string
Address string
Amount []AddressAmountInfo
OutputIndex uint32
Collateral bool
}
TransactionOutputInfo holds one transaction output.
type TransactionOutputResponse ¶
type TransactionOutputResponse struct {
ReferenceScriptHash *string `json:"reference_script_hash"`
InlineDatum *string `json:"inline_datum"`
DataHash *string `json:"data_hash"`
ConsumedByTx *string `json:"consumed_by_tx"`
Address string `json:"address"`
Amount []AddressAmountResponse `json:"amount"`
OutputIndex int `json:"output_index"`
Collateral bool `json:"collateral"`
}
TransactionOutputResponse represents one transaction output.
type TransactionPoolMetadataInfo ¶
TransactionPoolMetadataInfo holds on-chain pool metadata pointer data.
type TransactionPoolMetadataResponse ¶
TransactionPoolMetadataResponse represents pool metadata pointer data.
type TransactionPoolRelayInfo ¶
TransactionPoolRelayInfo holds one pool relay from a pool registration cert.
type TransactionPoolRelayResponse ¶
type TransactionPoolRelayResponse struct {
DNS *string `json:"dns"`
DNSSrv *string `json:"dns_srv"`
IPv4 *string `json:"ipv4"`
IPv6 *string `json:"ipv6"`
Port *int `json:"port"`
}
TransactionPoolRelayResponse represents one relay in a pool registration cert.
type TransactionPoolRetireInfo ¶
TransactionPoolRetireInfo holds one pool retirement certificate.
type TransactionPoolRetireResponse ¶
type TransactionPoolRetireResponse struct {
PoolID string `json:"pool_id"`
CertIndex int `json:"cert_index"`
RetiringEpoch uint64 `json:"retiring_epoch"`
}
TransactionPoolRetireResponse represents one pool retirement certificate.
type TransactionPoolUpdateInfo ¶
type TransactionPoolUpdateInfo struct {
Metadata *TransactionPoolMetadataInfo
Owners []string
Relays []TransactionPoolRelayInfo
ActiveEpoch uint64
CertIndex int
FixedCost string
MarginCost float64
Pledge string
PoolID string
RewardAccount string
VrfKey string
}
TransactionPoolUpdateInfo holds one pool registration certificate.
type TransactionPoolUpdateResponse ¶
type TransactionPoolUpdateResponse struct {
Metadata *TransactionPoolMetadataResponse `json:"metadata"`
Owners []string `json:"owners"`
Relays []TransactionPoolRelayResponse `json:"relays"`
ActiveEpoch uint64 `json:"active_epoch"`
CertIndex int `json:"cert_index"`
FixedCost string `json:"fixed_cost"`
MarginCost float64 `json:"margin_cost"`
Pledge string `json:"pledge"`
PoolID string `json:"pool_id"`
RewardAccount string `json:"reward_account"`
VrfKey string `json:"vrf_key"`
}
TransactionPoolUpdateResponse represents one pool registration certificate.
type TransactionRedeemerInfo ¶
type TransactionRedeemerInfo struct {
DatumHash *string
TxIndex int
Purpose string
ScriptHash string
RedeemerDataHash string
UnitMem string
UnitSteps string
Fee string
}
TransactionRedeemerInfo holds one Plutus redeemer.
type TransactionRedeemerResponse ¶
type TransactionRedeemerResponse struct {
DatumHash *string `json:"datum_hash"`
TxIndex int `json:"tx_index"`
Purpose string `json:"purpose"`
ScriptHash string `json:"script_hash"`
RedeemerDataHash string `json:"redeemer_data_hash"`
UnitMem string `json:"unit_mem"`
UnitSteps string `json:"unit_steps"`
Fee string `json:"fee"`
}
TransactionRedeemerResponse represents one Plutus redeemer.
type TransactionRejectedError ¶ added in v0.70.4
type TransactionRejectedError struct {
Cause error
}
TransactionRejectedError reports a transaction the mempool judged and declined, carrying the reason as a separate error rather than only inside the message text. Handlers read Cause to report why the transaction was rejected instead of recovering it from the formatted message, which only works while the sentinel is the outermost prefix.
func (*TransactionRejectedError) Error ¶ added in v0.70.4
func (e *TransactionRejectedError) Error() string
func (*TransactionRejectedError) Unwrap ¶ added in v0.70.4
func (e *TransactionRejectedError) Unwrap() []error
Unwrap exposes the sentinel and the cause together, so errors.Is matches both ErrTransactionRejected and whatever the mempool returned.
type TransactionRequiredSignerInfo ¶
type TransactionRequiredSignerInfo struct {
WitnessHash string
}
TransactionRequiredSignerInfo holds one required signing key hash.
type TransactionRequiredSignerResponse ¶
type TransactionRequiredSignerResponse struct {
WitnessHash string `json:"witness_hash"`
}
TransactionRequiredSignerResponse represents one required signing key hash.
type TransactionResponse ¶
type TransactionResponse struct {
InvalidBefore *string `json:"invalid_before"`
InvalidHereafter *string `json:"invalid_hereafter"`
OutputAmount []AddressAmountResponse `json:"output_amount"`
Hash string `json:"hash"`
Block string `json:"block"`
Deposit string `json:"deposit"`
Fees string `json:"fees"`
TreasuryDonation string `json:"treasury_donation"`
Slot uint64 `json:"slot"`
BlockHeight uint64 `json:"block_height"`
BlockTime int64 `json:"block_time"`
Size int `json:"size"`
Index int `json:"index"`
UtxoCount int `json:"utxo_count"`
WithdrawalCount int `json:"withdrawal_count"`
MirCertCount int `json:"mir_cert_count"`
DelegationCount int `json:"delegation_count"`
StakeCertCount int `json:"stake_cert_count"`
PoolUpdateCount int `json:"pool_update_count"`
PoolRetireCount int `json:"pool_retire_count"`
AssetMintBurnCount int `json:"asset_mint_or_burn_count"`
RedeemerCount int `json:"redeemer_count"`
ValidContract bool `json:"valid_contract"`
}
TransactionResponse represents a Blockfrost transaction content object.
type TransactionStakeAddressInfo ¶
TransactionStakeAddressInfo holds one stake registration/deregistration certificate.
type TransactionStakeAddressResponse ¶
type TransactionStakeAddressResponse struct {
Address string `json:"address"`
CertIndex int `json:"cert_index"`
Registration bool `json:"registration"`
}
TransactionStakeAddressResponse represents one stake address certificate.
type TransactionSubmitter ¶
TransactionSubmitter accepts raw transaction CBOR for mempool admission.
type TransactionUTXOsInfo ¶
type TransactionUTXOsInfo struct {
Hash string
Inputs []TransactionInputInfo
Outputs []TransactionOutputInfo
}
TransactionUTXOsInfo holds transaction inputs and outputs.
type TransactionUTXOsResponse ¶
type TransactionUTXOsResponse struct {
Hash string `json:"hash"`
Inputs []TransactionInputResponse `json:"inputs"`
Outputs []TransactionOutputResponse `json:"outputs"`
}
TransactionUTXOsResponse represents transaction inputs and outputs.
type TransactionWithdrawalInfo ¶
TransactionWithdrawalInfo holds one reward withdrawal.
type TransactionWithdrawalResponse ¶
type TransactionWithdrawalResponse struct {
Address string `json:"address"`
Amount string `json:"amount"`
}
TransactionWithdrawalResponse represents one reward withdrawal.
Source Files
¶
- adapter.go
- adapter_account_activity.go
- adapter_pool_detail.go
- adapter_pools_extended_metadata.go
- adapter_pools_list.go
- adapter_token_registry.go
- blockfrost.go
- cip25.go
- config.go
- evaluate.go
- handlers.go
- handlers_account_activity.go
- handlers_pool_detail.go
- handlers_pools_list.go
- node_interface.go
- pagination.go
- provider.go
- types.go