Provider-Only Client
Query blockchain data without wallet configuration
Provider-Only Client
A provider-only client gives you blockchain access without wallet configuration. Use it to query any address, fetch protocol parameters, and submit pre-signed transactions.
When to Use
Provider-only clients are ideal when you need blockchain data but not wallet-specific operations:
Use provider-only client for:
- Blockchain explorers querying multiple addresses
- Transaction submission services
- Protocol parameter monitoring
- Generic datum resolution
- Multi-address portfolio tracking
Use read-only client instead for:
- Building unsigned transactions for specific user
- Backend transaction building in dApps
- Wallet-specific UTxO queries
- User delegation information
Basic Setup
Create a client with only provider configuration:
import {
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
// Query any address
const = await .(
.(
"addr1qxy8sclc58rsck0pzsc0v4skmqjwuqsqpwfcvrdldl5sjvvhyltp7fk0fmtmrlnykgmhnzcns2msa2cmpvllzgqd2azqhpv8e4"
)
)
.("Found UTxOs:", .)
// Get protocol parameters
const = await .()
.("Min fee A:", .)Available Methods
Provider-only clients expose all provider methods directly:
import {
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
// Protocol parameters
const = await .()
// UTxO queries - use Address.fromBech32 for addresses
const = .(
"addr1qxy8sclc58rsck0pzsc0v4skmqjwuqsqpwfcvrdldl5sjvvhyltp7fk0fmtmrlnykgmhnzcns2msa2cmpvllzgqd2azqhpv8e4"
)
const = await .()
const = await .(, "lovelace")
const = await .([
new .({
: .("abc123def456..."),
: 0n
})
])
// Delegation
const = await .(..("stake1uxy..."))
// Datum resolution
const = await .(new .({ : .("datum-hash-here") }))
// Transaction operations
const = "84a300..."
const = .()
const = await .()
const = await .()
const = "84a300..."
const = .()
const = await .()Querying Multiple Addresses
Portfolio tracker for multiple addresses:
import {
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
// Portfolio tracker
async function (: string[]) {
const = await .(
.(async () => {
const = await .(.())
const = .((, ) => + .., 0n)
return { : , }
})
)
return
}
// Usage with actual addresses
const = await ([
"addr1qxy8sclc58rsck0pzsc0v4skmqjwuqsqpwfcvrdldl5sjvvhyltp7fk0fmtmrlnykgmhnzcns2msa2cmpvllzgqd2azqhpv8e4"
])Transaction Submission Service
Accept signed transactions and submit to blockchain:
import {
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
// API endpoint
export async function (: string) {
try {
const = .()
const = await .()
// Wait for confirmation
const = await .(, 5000)
return {
: true,
,
}
} catch (: any) {
return {
: false,
: .message
}
}
}Protocol Parameter Monitoring
Track network parameters for fee estimation or protocol changes:
import {
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
async function () {
const = await .()
return {
: .,
: .,
: .,
: .,
: .,
: .,
: .,
: .
}
}
// Check parameters periodically
(async () => {
const = await ()
.("Current parameters:", )
}, 3600000) // Every hourLimitations
Provider-only clients cannot perform wallet-scoped operations, but they can still create builders when you provide the missing address and signing context manually:
import {
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
// Can create a builder, but wallet-scoped helpers are still unavailable
const = .()
// Cannot sign - no private key
// @ts-expect-error - Property 'signTx' does not exist on provider-only client
.signTx("84a400...")
// Cannot get own address - no wallet
// @ts-expect-error - Property 'address' does not exist on provider-only client
.address()
// Cannot query wallet-scoped UTxOs without address context
// @ts-expect-error - Property 'getWalletUtxos' does not exist on provider-only client
.getWalletUtxos()
// CAN query any address
const = .(
"addr1qxy8sclc58rsck0pzsc0v4skmqjwuqsqpwfcvrdldl5sjvvhyltp7fk0fmtmrlnykgmhnzcns2msa2cmpvllzgqd2azqhpv8e4"
)
const = await .()
// CAN submit pre-signed transactions
const = "84a400..." // Example signed transaction CBOR
const = .()
const = await .()Upgrading to Read-Only Client
Add address context to a provider-only client using .withAddress():
import {
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
// Start with provider only
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
// Later, add address context for a specific user
const =
.("addr1qxy8g0m3dnvxpk6dlh40u9vgc8m6hyqyjf6qn6j6t47wnhvcpqp0aw50nln8nyzfh6fjp6sxgajx5q0c6p73xqf2qhvq5pzqsh")
// Now can build transactions for this address
const = .()
.({
: .(
"addr1qxh7f8gxv43dxz7k2vf6x5cxj5f5mk5mmqfk5u7qp7t2nvw9pqp0aw50nln8nyzfh6fjp6sxgajx5q0c6p73xqf2qhvqwlx8f7"
),
: .(5000000n)
})
const = await .()Environment Configuration
Switch between environments:
import {
,
,
,
,
,
,
,
,
,
,
,
} from "@evolution-sdk/evolution"
const = (.. || "development") as "development" | "production"
const =
=== "production"
? .().({
: ..!,
: ..!
})
: .().({
: "https://cardano-preprod.blockfrost.io/api/v0",
: ..!
})Comparison with Read-Only Client
| Feature | Provider-Only Client | Read-Only Client |
|---|---|---|
| Configuration | Provider only | Provider + address |
| Creation | client(chain).withBlockfrost(...) | client(chain).withBlockfrost(...).withAddress(address) |
| Query any address | getUtxos(anyAddress) | getUtxos(anyAddress) |
| Query own address | Not available | getWalletUtxos() |
| Build transactions | newTx() with manual context | newTx() returns unsigned tx |
| Sign transactions | Not available | Not available |
| Submit transactions | submitTx(signedCbor) | submitTx(signedCbor) |
| Use case | Generic queries, multi-address | Backend building for specific user |
Next Steps
Learn more about provider capabilities:
- Querying - Master all query methods
- Submission - Transaction submission patterns
- Use Cases - Real-world examples