You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(ecosystem-adapters): keep parent ecosystem nav on adapter routes
Use lastEcosystem for /ecosystem-adapters like relayer/monitor; drop
standalone ecosystemAdaptersTree. Add tab url rules and midnight context.
Polish MDX prose; document viem isAddress for EVM addressing.
Copy file name to clipboardExpand all lines: content/ecosystem-adapters/architecture.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Architecture
3
3
---
4
4
5
-
This page describes the capability-based architecture that underpins all OpenZeppelin Ecosystem Adapters. Understanding this architecture will help you choose the right profile for your application, consume capabilities efficiently, and — if needed — build your own adapter.
5
+
This page describes the capability-based architecture that underpins all OpenZeppelin Ecosystem Adapters. Understanding this architecture will help you choose the right profile for your application, consume capabilities efficiently, and build your own adapter if you need to.
6
6
7
7
## Package Topology
8
8
@@ -54,7 +54,7 @@ Tier isolation is enforced physically through sub-path exports, not tree-shaking
54
54
-**Tier 2** modules may import from Tier 1
55
55
-**Tier 3** modules may import from Tier 1 and Tier 2
56
56
57
-
This means importing `@openzeppelin/adapter-evm/addressing` will never pull in wallet SDKs, RPC clients, or access control code — regardless of your bundler configuration.
57
+
This means importing `@openzeppelin/adapter-evm/addressing` will never pull in wallet SDKs, RPC clients, or access control code, regardless of your bundler configuration.
58
58
59
59
### Capability Reference
60
60
@@ -76,11 +76,11 @@ This means importing `@openzeppelin/adapter-evm/addressing` will never pull in w
76
76
77
77
## Profiles
78
78
79
-
Profiles are pre-composed bundles of capabilities that match common application archetypes. They exist for convenience — you can always consume individual capabilities directly via the `CapabilityFactoryMap`.
79
+
Profiles are pre-composed bundles of capabilities that match common application archetypes. They exist for convenience. You can always consume individual capabilities directly via the `CapabilityFactoryMap`.
80
80
81
-
Each profile is a strict superset of Declarative — higher profiles add capabilities incrementally:
81
+
Each profile is a strict superset of Declarative. Higher profiles add capabilities incrementally:
This is exactly what `adapter-polkadot` does — it delegates ABI loading, queries, transaction execution, and wallet infrastructure to the shared EVM core while adding Polkadot-specific metadata and network configurations.
300
+
This is exactly what `adapter-polkadot` does. It delegates ABI loading, queries, transaction execution, and wallet infrastructure to the shared EVM core while adding Polkadot-specific metadata and network configurations.
The `createRuntime` call is **synchronous** — it assembles capability instances immediately. Expensive initialization (RPC connections, wallet discovery) happens lazily on first use.
59
+
The `createRuntime` call is **synchronous**. It assembles capability instances immediately. Expensive initialization (RPC connections, wallet discovery) happens lazily on first use.
60
60
61
61
If you request a profile the adapter doesn't fully support, `createRuntime` throws an `UnsupportedProfileError` listing the missing capabilities.
62
62
@@ -65,10 +65,10 @@ If you request a profile the adapter doesn't fully support, `createRuntime` thro
65
65
Access capabilities directly from the runtime object:
66
66
67
67
```ts
68
-
// Validate an address (Tier 1 — instant, no network call)
68
+
// Validate an address (Tier 1: instant, no network call)
// Read contract state (Tier 2 — triggers RPC on first call)
71
+
// Read contract state (Tier 2: triggers RPC on first call)
72
72
const result =awaitruntime.query.queryViewFunction(
73
73
'0xContractAddress',
74
74
'balanceOf',
@@ -149,7 +149,7 @@ export default mergeConfig(
149
149
);
150
150
```
151
151
152
-
This centralizes `resolve.dedupe`, `optimizeDeps`, `ssr.noExternal`, and any adapter-specific Vite plugins — adapters remain the source of truth for their own build requirements.
152
+
This centralizes `resolve.dedupe`, `optimizeDeps`, `ssr.noExternal`, and any adapter-specific Vite plugins. Adapters remain the source of truth for their own build requirements.
153
153
154
154
## Network Switching
155
155
@@ -194,7 +194,7 @@ Adapters integrate with React through three layers: a **wallet context provider*
194
194
195
195
### Wallet Context Provider
196
196
197
-
Each adapter exports a root React component via `getEcosystemReactUiContextProvider()`. This component wraps your application (or the relevant subtree) and bootstraps the wallet SDK context — for example, EVM adapters render `WagmiProvider` and `QueryClientProvider` internally, while the Stellar adapter renders its own `StellarWalletContext.Provider`.
197
+
Each adapter exports a root React component via `getEcosystemReactUiContextProvider()`. This component wraps your application (or the relevant subtree) and bootstraps the wallet SDK context. For example, EVM adapters render `WagmiProvider` and `QueryClientProvider` internally, while the Stellar adapter renders its own `StellarWalletContext.Provider`.
198
198
199
199
You don't render these providers yourself. Instead, pass the runtime to a shared `WalletStateProvider` from `@openzeppelin/ui-react`, which delegates to the correct ecosystem provider automatically:
`connectWallet` and `disconnectWallet` are imperative calls on the runtime — they are independent of the React rendering layer. You can call them from event handlers, effects, or outside React entirely.
269
+
`connectWallet` and `disconnectWallet` are imperative calls on the runtime. They are independent of the React rendering layer. You can call them from event handlers, effects, or outside React entirely.
270
270
</Callout>
271
271
272
272
### Hook Facade Pattern
@@ -295,7 +295,7 @@ Each facade object includes these hooks:
295
295
|`useChains`| Returns the list of configured chains |
296
296
|`useBalance`| Returns the native token balance for the connected account |
297
297
298
-
In practice, you access facade hooks through the runtime rather than importing them directly — the runtime's `uiKit.getEcosystemReactHooks()` method returns the correct facade for the active ecosystem:
298
+
In practice, you access facade hooks through the runtime rather than importing them directly. The runtime's `uiKit.getEcosystemReactHooks()` method returns the correct facade for the active ecosystem:
Hooks that don't apply to a given ecosystem return safe stubs. For example, the Stellar facade's `useSwitchChain` returns `{ switchChain: undefined }` — your components can feature-detect this without conditional imports.
323
+
Hooks that don't apply to a given ecosystem return safe stubs. For example, the Stellar facade's `useSwitchChain` returns `{ switchChain: undefined }`. Your components can feature-detect this without conditional imports.
324
324
</Callout>
325
325
326
326
## Multi-Ecosystem Apps
327
327
328
-
Applications that interact with multiple blockchains create one runtime per ecosystem. Each runtime is independent — it manages its own wallet session, RPC connections, and lifecycle.
328
+
Applications that interact with multiple blockchains create one runtime per ecosystem. Each runtime is independent. It manages its own wallet session, RPC connections, and lifecycle.
329
329
330
330
### Setup
331
331
@@ -359,16 +359,16 @@ Instantiate a runtime from each adapter's `ecosystemDefinition`:
Each runtime is fully isolated. The EVM runtime connects to Ethereum via wagmi, the Stellar runtime connects to Horizon/Soroban — they share no state and can be disposed independently:
371
+
Each runtime is fully isolated. The EVM runtime connects to Ethereum via wagmi, the Stellar runtime connects to Horizon/Soroban. They share no state and can be disposed independently:
372
372
373
373
```ts
374
374
// Use both runtimes side by side
@@ -385,7 +385,7 @@ evmRuntime.dispose();
385
385
```
386
386
387
387
<Callouttype="info">
388
-
Wallet sessions are ecosystem-scoped, not runtime-scoped. Disposing an EVM runtime to switch from Mainnet to Sepolia does not disconnect the user's MetaMask — the wallet session persists across runtime recreation within the same ecosystem.
388
+
Wallet sessions are ecosystem-scoped, not runtime-scoped. Disposing an EVM runtime to switch from Mainnet to Sepolia does not disconnect the user's MetaMask. The wallet session persists across runtime recreation within the same ecosystem.
Copy file name to clipboardExpand all lines: content/ecosystem-adapters/index.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Ecosystem Adapters
3
3
---
4
4
5
-
**OpenZeppelin Ecosystem Adapters** are a set of modular, chain-specific integration packages that let applications interact with any supported blockchain through a single, unified interface. Built on 13 composable capability interfaces organized in 3 tiers, each adapter encapsulates everything needed — contract loading, type mapping, transaction execution, wallet connection, and network configuration — while keeping consuming applications completely chain-agnostic.
5
+
**OpenZeppelin Ecosystem Adapters** are a set of modular, chain-specific integration packages that let applications interact with any supported blockchain through a single, unified interface. Built on 13 composable capability interfaces organized in 3 tiers, each adapter encapsulates contract loading, type mapping, transaction execution, wallet connection, and network configuration in one place, while keeping consuming applications completely chain-agnostic.
6
6
7
7
<Callouttype="info">
8
8
**Source code**: The adapters are open-source. Browse the implementation, open issues, and contribute at [**github.com/OpenZeppelin/openzeppelin-adapters**](https://github.com/OpenZeppelin/openzeppelin-adapters).
@@ -25,14 +25,14 @@ title: Ecosystem Adapters
25
25
26
26
## Why Adapters?
27
27
28
-
Building cross-chain tooling traditionally forces developers into one of two traps: a monolithic abstraction that leaks chain details, or per-chain forks that drift apart over time. Adapters solve this with a **capability-based decomposition** — each chain implements only the interfaces it supports, and consuming applications pull in only what they need.
28
+
Building cross-chain tooling traditionally forces developers into one of two traps: a monolithic abstraction that leaks chain details, or per-chain forks that drift apart over time. Adapters solve this with a **capability-based decomposition**. Each chain implements only the interfaces it supports, and consuming applications pull in only what they need.
-**Pay for what you use.** Tier 1 capabilities are stateless and never pull in wallet SDKs or RPC clients. Import `addressing` and you get only address validation — nothing more.
44
+
-**Pay for what you use.** Tier 1 capabilities are stateless and never pull in wallet SDKs or RPC clients. Import `addressing` and you get only address validation; nothing else is bundled.
45
45
-**Profiles simplify consumption.** Five pre-composed profiles (Declarative, Viewer, Transactor, Composer, Operator) match common application archetypes so you don't have to assemble capabilities manually.
46
-
-**Adapters own their chains.** All chain-specific logic — ABI parsing, Soroban type mapping, ZK proof orchestration — stays inside the adapter package. The consuming application never touches it.
47
-
-**Runtime lifecycle is explicit.** Runtimes are immutable and network-scoped. Switching networks means disposing the old runtime and creating a new one — no hidden state mutations.
46
+
-**Adapters own their chains.** All chain-specific logic (ABI parsing, Soroban type mapping, ZK proof orchestration) stays inside the adapter package. The consuming application never touches it.
47
+
-**Runtime lifecycle is explicit.** Runtimes are immutable and network-scoped. Switching networks means disposing the old runtime and creating a new one. There are no hidden state mutations.
48
48
49
49
## Packages
50
50
@@ -63,10 +63,10 @@ flowchart LR
63
63
64
64
Adapters are consumed by several OpenZeppelin products:
0 commit comments