Clients
Clients
Client types combining wallets and providers
Clients
Clients assemble chain-scoped capabilities into one runtime surface. Start with client(chain), then add read access, address context, or signing capability with .withX(...).
Submission only appears once a provider stage is present. Wallet-only assembly stages can sign, but they still hand signed transactions to a provider-backed client or backend for broadcast.
Overview
A client's capabilities depend on which stages you add:
- Provider stage: Enables blockchain queries and transaction submission
- Address stage: Adds wallet address context without signing
- Signer stage: Adds transaction and message signing
Different combinations create different client stages with distinct capabilities.
Client Types
| Client Stage | Added Via | Can Query | Can Build Tx | Can Sign | Can Submit |
|---|---|---|---|---|---|
| Read Client | .withBlockfrost() or peers | ✅ | ❌ | ❌ | ✅ |
| Address Client | .withAddress() | ❌ | ❌ | ❌ | ❌ |
| Offline Signer Client | .withSeed(), .withPrivateKey(), .withCip30() | ❌ | ❌ | ✅ | ❌ |
| Read-Only Client | Provider + .withAddress() | ✅ | ✅ | ❌ | ✅ |
| Signing Client | Provider + signing capability | ✅ | ✅ | ✅ | ✅ |
Configuration Pattern
All clients start with client(chain) and add capabilities as needed:
const readClient = client(preprod).withBlockfrost({ ... })
const addressClient = client(preprod).withAddress("addr_test1...")
const signingClient = client(preprod).withBlockfrost({ ... }).withSeed({ ... })Rules:
client(chain)is the empty assembly stage- Add a provider first when you need blockchain reads or submission
- Add
.withAddress()when you only need wallet context - Add
.withSeed(),.withPrivateKey(), or.withCip30()when you need signing .withCip30()without a provider is a signing-only stage; submission still happens through provider-backed infrastructure
Decision Tree
What do you need to do?
Build + Sign + Submit transactions?
├─ Development/Testing → Signing Client with `.withSeed()`
└─ Production automation → Signing Client with `.withPrivateKey()`
Sign only in the browser (with provider-backed submission elsewhere)?
└─ Offline Signer Client with `.withCip30()`
Build only (backend)?
└─ Read-Only Client with `.withAddress()`
Query + Submit pre-signed?
└─ Read ClientNext Steps
- Client Basics - Understanding client capabilities
- Provider Setup - Provider configuration comparison
- Architecture - Frontend/backend patterns
- Wallets - Wallet types and security
- Providers - Provider-only client patterns