Querying
Query UTxOs
Query unspent transaction outputs by address, credential, or asset
Query UTxOs
UTxOs (Unspent Transaction Outputs) represent available funds on the blockchain. Evolution SDK provides several methods to query UTxOs based on different criteria.
By Address
import { , } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
const = .("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63")
const = await .()
for (const of ) {
.("UTxO:", ., "#", .)
.(" Lovelace:", ..)
}Wallet UTxOs
Query all UTxOs belonging to your connected wallet:
import { } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
const = await .()
const = .((, ) => + .., 0n)
.("Total balance:", , "lovelace")By Asset
Find UTxOs containing a specific native token:
import { , } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
const = .("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63")
const = "7edb7a2d9fbc4d2a68e4c9e9d3d7a5c8f2d1e9f8a7b6c5d4e3f2a1b0c9d8e7f6"
// UTxOs at address containing this token
const = await .(, )
// Find the single UTxO holding an NFT (unique token)
const = await .()By Output Reference
Fetch specific UTxOs by their transaction hash and output index:
import { } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
declare const : any[]
const = await .()Next Steps
- Datums — Query datum values
- Delegation — Check delegation status
- Transaction Status — Wait for confirmations