Helios API/ API Reference/ Classes/

BlockfrostV0

Blockfrost specific implementation of Network.

Implements

Implements

Index

Constructors

constructor

new BlockfrostV0(networkName, projectId)

Constructs a BlockfrostV0 using the network name (preview, preprod or mainnet) and your Blockfrost project_id.

Parameters

NameType
networkName"preview" | "preprod" | "mainnet"
projectIdstring

Accessors

networkName

get networkName(): string

Returns

string

Methods

dumpMempool

dumpMempool(): Promise<void>

Allows inspecting the live Blockfrost mempool.

Returns

Promise<void>

getLatestEpoch

getLatestEpoch(): Promise<any>

Returns

Promise<any>

getParameters

getParameters(): Promise<NetworkParams>

Returns

Promise<NetworkParams>

Implementation of

Network.getParameters

getUtxo

getUtxo(id): Promise<TxInput>

If the UTxO isn't found an error is throw with the following message format: "UTxO <txId.utxoId> not found".

Parameters

NameType
idTxOutputId

Returns

Promise<TxInput>

Implementation of

Network.getUtxo

getUtxos

getUtxos(address): Promise<TxInput[]>

Gets a complete list of UTxOs at a given Address. Returns oldest UTxOs first, newest last.

Parameters

NameType
addressAddress

Returns

Promise<TxInput[]>

Implementation of

Network.getUtxos

hasUtxo

hasUtxo(utxo): Promise<boolean>

Used by BlockfrostV0.resolve().

Parameters

NameType
utxoTxInput

Returns

Promise<boolean>

submitTx

submitTx(tx): Promise<TxId>

Submits a transaction to the blockchain.

Parameters

NameType
txTx

Returns

Promise<TxId>

Implementation of

Network.submitTx

resolve

Static resolve(utxoOrWallet, projectIds): Promise<BlockfrostV0>

Connects to the same network a given Wallet or the given TxInput (preview, preprod or mainnet).

Throws an error if a Blockfrost project_id is missing for that specific network.

Parameters

NameType
utxoOrWalletTxInput | Wallet
projectIdsObject
projectIds.mainnet?string
projectIds.preprod?string
projectIds.preview?string

Returns

Promise<BlockfrostV0>

resolveUsingUtxo

Static resolveUsingUtxo(refUtxo, projectIds): Promise<BlockfrostV0>

Throws an error if a Blockfrost project_id is missing for that specific network.

Parameters

NameType
refUtxoTxInput
projectIdsObject
projectIds.mainnet?string
projectIds.preprod?string
projectIds.preview?string

Returns

Promise<BlockfrostV0>

resolveUsingWallet

Static resolveUsingWallet(wallet, projectIds): Promise<BlockfrostV0>

Connects to the same network a given Wallet is connected to (preview, preprod or mainnet).

Throws an error if a Blockfrost project_id is missing for that specific network.

Parameters

NameType
walletWallet
projectIdsObject
projectIds.mainnet?string
projectIds.preprod?string
projectIds.preview?string

Returns

Promise<BlockfrostV0>