UTxORPC Provider
Highly efficient through gRPC, using a compact and high-performance binary format
The UTxORPC (u5c) provider facilitates access to this state in a standardized and efficient manner through gRPC, using a compact and high-performance binary format. It enables seamless interaction with the Cardano blockchain, to facilitate the creation, signing, and submission of transactions.
- Standardized Interface: Implements the UTxORPC specification to ensure compatibility and interoperability across UTxO-based blockchains.
- Performance Optimized: Utilizes gRPC for efficient communication with blockchain nodes, minimizing network overhead and message size.
- Flexible Provider Options: Suitable for use with hosted services, local nodes like Dolos, or any UTxORPC-compliant service.
The following code samples assume that the UTxORPC node is running locally on localhost:50051. If your node is hosted remotely or on a different server, replace "http://localhost:50051" with the appropriate server URL and port for your environment.
You can also use the UTxORPC provider with a hosted service like Demeter.run. Demeter is a PaaS (Platform-as-a-Service) that provides managed Cardano infrastructure. One of their services consists of a cloud-hosted endpoint for Cardano integration using the UTxO RPC spec. Developers can sign-up and get access to the API on a per-request basis.
For more details on configuring your node, refer to the UTxORPC Ecosystem Servers Documentation.
Get data from URL
You can fetch any data from the blockchain by providing the URL path.
Fetch data from the blockchain
Fetch Account Info
Obtain information about a specific stake account.
Fetch account info using stake address
Fetch Address Assets
Fetch assets from an address.
Fetch UTxOs 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 UTxOs from address
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 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 metadata from asset ID
Fetch Block Info
Fetch block infomation. You can get the hash from fetchTxInfo()
.
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 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 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 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 of the blockchain by epoch
Fetch Transaction Info
Fetch transaction infomation. Only confirmed transaction can be retrieved.
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 given hash
Fetch Proposal Info
Get information for a given governance proposal, identified by the txHash and proposal index
Fetch Proposals for a given TxHash and certIndex
Evaluate Transaction
evaluateTx()
accepts an unsigned transaction (unsignedTx
) and it evaluates the resources required to execute the transaction. Note that, this is only valid for transaction interacting with redeemer (smart contract). By knowing the budget required, you can use this to adjust the redeemer's budget so you don't spend more than you need to execute transactions for this smart contract.
Example responses from unlocking assets from the always succeed smart contract.
With the mem
and steps
, you can refine the budget for the redeemer. For example:
Evaluate the resources required to execute a transaction
Submit Transaction
Submit a serialized transaction to the network.
On Transaction Confirmed
Allow you to listen to a transaction confirmation. Upon confirmation, the callback will be called.