OfflineFetcher

An offline blockchain data provider for testing, development and offline scenarios.

The OfflineFetcher provides access to blockchain data without requiring network connectivity. It's ideal for testing, development, and scenarios where you need to work with pre-loaded blockchain data offline.

Initialize the fetcher:

Before you can fetch data, you need to add it to the fetcher. Here are examples of adding different types of blockchain data:

The fetcher's state can be saved and loaded, making it easy to persist data between sessions:

Once data is added, you can use the fetch* methods just like with other providers such as BlockfrostProvider. This makes OfflineFetcher a drop-in replacement for testing and offline scenarios.

Get data from URL

You can fetch any data from the blockchain by providing the URL path.

Get data from URL

Fetch data from the blockchain

Fetch Account Info

Obtain information about a specific stake account.

Fetch Account Info

Fetch account info using stake address

Fetch Address Assets

Fetch assets from an address.

Fetch Address UTxOs

Fetch UTxOs from address

Fetch assets from address

Fetch assets given an address

Fetch Address UTxOs

Fetch UTxOs controlled by an address.

Optionally, you can filter UTXOs containing a particular asset by providing asset, where it is the concatenation of policy ID and asset.

Fetch Address UTxOs

Fetch UTxOs from address

Fetch UTxOs with Asset

Fetch UTxOs from address with asset

Fetch Asset Addresses

Fetch a list of a addresses containing a specific asset where it is the concatenation of policy ID and asset.

Fetch Asset Addresses

Fetch list of addresses containing a specific asset

Fetch Asset Metadata

Fetch the asset metadata by providing asset's unit, which is the concatenation of policy ID and asset name in hex.

Fetch Asset Metadata

Fetch metadata from asset ID

Fetch Block Info

Fetch block infomation. You can get the hash from fetchTxInfo().

Fetch Block Info

Fetch information about a block

Fetch Collection Assets

Fetch a list of assets belonging to a collection by providing its Policy ID.

The API will return a list of assets and a cursor next. If the cursor is not null, you can use it to fetch the next page of results. Here is an example of the response.

The fetchCollectionAssets function also accepts an optional cursor parameter to fetch the next page of results. The default value is 1.

Fetch Collection Assets

Fetch list of assets belonging to a collection and its quantity

Fetch Handle Address

ADA Handle allows users to use a human-readable "Handle" to associate an address.

Each Handle is a unique NFT, minted and issued on the Cardano blockchain. These NFTs act as unique identifiers for the UTXO that they reside in.

We can resolve the handle's address with fetchHandleAddress.

Fetch Handle Address

Fetch address by handle

Fetch Handle

ADA Handle allows users to use a human-readable "Handle" to associate an address.

Each Handle is a unique NFT, minted and issued on the Cardano blockchain. These NFTs act as unique identifiers for the UTXO that they reside in.

ADA Handle also released a CIP68 handle and this function will fetch the metadata of the handle.

Fetch Handle

Fetch handle metadata

Fetch Protocol Parameters

Fetch the latest protocol parameters.

Optionally, you can provide an epoch number to fetch the protocol parameters of that epoch.

Fetch Protocol Parameters

Fetch protocol parameters of the blockchain by epoch

Fetch Transaction Info

Fetch transaction infomation. Only confirmed transaction can be retrieved.

Fetch Transaction Info

Fetch information about a transaction

Fetch UTxOs

Get UTxOs for a given hash.

Optionally, you can specify the index of the index output.

Fetch UTxOs

Fetch UTxOs given hash