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 = ({
: "mainnet",
: {
: "blockfrost",
: "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 = ({
: "mainnet",
: {
: "blockfrost",
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
}
});
// Protocol parameters
const = await .();
// UTxO queries - use Core.Address.fromBech32 for addresses
const = ..("addr1qxy8sclc58rsck0pzsc0v4skmqjwuqsqpwfcvrdldl5sjvvhyltp7fk0fmtmrlnykgmhnzcns2msa2cmpvllzgqd2azqhpv8e4");
const = await .();
const = await .(, "lovelace");
const = await .([
{ : "abc123def456...", : 0 }
]);
// Delegation
const = await .("stake1...");
// Datum resolution
const = await .("datum-hash-here");
// Transaction operations
const = "84a300...";
const = await .();
const = await .();
const = "84a300...";
const = await .();Querying Multiple Addresses
Portfolio tracker for multiple addresses:
import { , } from "@evolution-sdk/evolution";
const = ({
: "mainnet",
: {
: "blockfrost",
: "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 = ({
: "mainnet",
: {
: "blockfrost",
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
}
});
// API endpoint
export async function (: string) {
try {
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 = ({
: "mainnet",
: {
: "blockfrost",
: "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-specific operations:
import { , } from "@evolution-sdk/evolution";
const = ({
: "mainnet",
: {
: "blockfrost",
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
}
});
// Cannot build transactions - no wallet address
// @ts-expect-error - Property 'newTx' does not exist on provider-only client
.newTx();
// Cannot sign - no private key
// @ts-expect-error - Property 'signTx' does not exist on provider-only client
.signTx();
// Cannot get own address - no wallet
// @ts-expect-error - Property 'address' does not exist on provider-only client
.address();
// CAN query any address
const = ..("addr1qxy8sclc58rsck0pzsc0v4skmqjwuqsqpwfcvrdldl5sjvvhyltp7fk0fmtmrlnykgmhnzcns2msa2cmpvllzgqd2azqhpv8e4");
const = await .();
// CAN submit pre-signed transactions
const = "84a400..."; // Example signed transaction CBOR
const = await .();Upgrading to Full Client
Add wallet to provider-only client using attachWallet():
import { , } from "@evolution-sdk/evolution";
// Start with provider only
const = ({
: "mainnet",
: {
: "blockfrost",
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
}
});
// Later, attach wallet for specific user
const = .({
: "read-only",
: "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 = {
: {
: "preprod" as ,
: {
: "blockfrost" as ,
: "https://cardano-preprod.blockfrost.io/api/v0",
: ..!
}
},
: {
: "mainnet" as ,
: {
: "kupmios" as ,
: ..!,
: ..!
}
}
};
const = ([]);Comparison with Read-Only Client
| Feature | Provider-Only Client | Read-Only Client |
|---|---|---|
| Configuration | Provider only | Provider + address |
| Creation | createClient({ provider }) | createClient({ provider, wallet: { type: "read-only", address } }) |
| Query any address | getUtxos(anyAddress) | getUtxos(anyAddress) |
| Query own address | Not available | getWalletUtxos() |
| Build transactions | Not available | 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