Querying
Querying
Query blockchain data through providers
Querying
Evolution SDK provides a unified query interface across all providers (Blockfrost, Maestro, Koios, Kupo/Ogmios). Query UTxOs, delegation status, protocol parameters, datums, and transaction confirmations through your client.
Available Queries
| Method | Returns | Description |
|---|---|---|
getUtxos(address) | UTxO[] | UTxOs at an address |
getWalletUtxos() | UTxO[] | Your wallet's UTxOs |
getUtxosWithUnit(address, unit) | UTxO[] | UTxOs containing a specific asset |
getUtxoByUnit(unit) | UTxO | Single UTxO holding an asset |
getUtxosByOutRef(refs) | UTxO[] | UTxOs by output reference |
getDelegation(rewardAddress) | Delegation | Stake delegation and rewards |
getDatum(hash) | Data | Datum by hash |
getProtocolParameters() | ProtocolParameters | Current protocol parameters |
awaitTx(hash) | boolean | Wait for transaction confirmation |
Quick Example
import { , } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
// Query wallet UTxOs
const = await .()
.("Wallet has", ., "UTxOs")
// Query specific address
const = .("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63")
const = await .()