One Interface, Many Chains: Designing a Multi-Chain Wallet Console with the Adapter Pattern
Reading time: 7 minutesFor the last year I have been the lead frontend engineer on an institutional platform for issuing tokenized assets. Issuers manage their assets through a console built around multisig wallets: someone proposes a transaction, other signers review it, and it executes once enough of them approve.
The console was built for EVM chains, and that assumption was everywhere: in how we fetched pending transactions, how we decoded them, how we formatted amounts and how we linked to explorers. Then the product needed to support IOTA, Solana and Canton: three chains, each with a transaction model that looks nothing like Ethereum’s, and nothing like each other.
This is the story of how I added non-EVM chains to an EVM-first app without rewriting it, and the design I would reach for again.
The problem
On an EVM chain, a multisig transaction is a familiar shape: a target address, a value, and calldata that you decode with the contract’s ABI. Token amounts come from an ERC-20 contract with a decimals() value. Explorer links follow a predictable pattern.
The new chains break those assumptions in three different ways:
- IOTA uses a Move-based, object-centric model. Assets are typed objects, a coin’s identity comes from the module that defines it (something like
0x…::module::SYMBOL) rather than from a contract address, and a transaction is a block of commands rather than a single call with calldata. - Solana is account-based in a different sense. A transaction is a list of instructions sent to programs, each listing the accounts it reads and writes. Tokens are identified by a mint address, and their decimals live on the mint account, not in an ERC-20 contract.
- Canton is built around Daml contracts between parties, with privacy at its core: much of the activity is visible only to the parties involved. Even ideas that feel universal on public chains, like “link to this transaction in a public explorer”, do not always apply.
Even “what is this token called and how many decimals does it have” needs a different answer on every one of them.
None of that is hard on its own. The problem was where the differences ended up. Every component that touched a transaction had started to grow its own if (chain === ...) branch.
The first attempt, and why it doesn’t scale
The quickest way to ship a second chain is to branch where the behaviour differs. Here is a simplified, made-up version of what that looks like:
function PendingTxRow({ tx, chain }: Props) {
const amount =
chain.type === "evm"
? formatUnits(tx.value, tx.token.decimals)
: formatMoveAmount(tx.coin.balance, tx.coin.metadata);
const label =
chain.type === "evm"
? decodeEvmCall(tx.data, tx.abi)?.functionName ?? "Contract call"
: describeMoveCommands(tx.commands);
const href =
chain.type === "evm"
? `${chain.explorer}/tx/${tx.hash}`
: `${chain.explorer}/txblock/${tx.digest}?network=${chain.network}`;
return <Row label={label} amount={amount} href={href} />;
}
It works, and for one extra chain it even looks reasonable. But it fails in three ways that get worse with every chain you add:
- The knowledge is scattered. What it means to “format an amount on IOTA” lives in a dozen components, and each copy drifts a little from the others.
- Every new chain touches everything. Adding a third network means finding and editing every branch, in every component, and hoping you found them all.
- The UI starts to know things it should not. A table row should not know what a Move module path is. Once it does, it cannot be tested, reused or reasoned about on its own.
I did not want the chain count to be a multiplier on the cost of every feature. So I stopped and redesigned the boundary.
The design: one adapter per network family
The rule I set was simple: components never ask which chain they are on. They ask an adapter.
Every network family implements one shared interface:
interface ChainAdapter {
readonly family: "evm" | "move" | "solana" | "canton";
/** Pending multisig proposals for an account, already normalised. */
fetchPending(account: string): Promise<PendingTx[]>;
/** Turn a raw transaction into actions a person can read. */
decodeTransaction(tx: RawTx): Promise<DecodedTx>;
/** Format a raw on-chain amount for display. */
formatAmount(amount: bigint, asset: AssetRef): string;
/** Link to this transaction (or address), if the chain has a meaningful public view. */
explorerUrl(ref: { tx?: string; address?: string }): string | undefined;
}
Behind it sit one implementation per network family:
- An EVM adapter, built on viem. It decodes calldata with the contract ABI, reads
decimals()and symbols from ERC-20 contracts and builds standard explorer links. - A Move adapter for IOTA. It resolves token symbols and decimals from the coin’s module type, understands the command-based transaction structure and builds IOTA explorer links.
- A Solana adapter. It reads token metadata from mint accounts, describes transactions instruction by instruction and links signatures to a Solana explorer.
- A Canton adapter. It describes Daml contract actions in terms of the parties and templates involved, and returns no explorer link where the activity is private, so the UI shows “visible to participants only” instead of a broken link.
A small registry maps each configured network to its adapter:
const adapters: Record<NetworkId, ChainAdapter> = {
ethereum: evmAdapter(ethereumConfig),
base: evmAdapter(baseConfig),
iota: moveAdapter(iotaConfig),
solana: solanaAdapter(solanaConfig),
canton: cantonAdapter(cantonConfig),
};
export const adapterFor = (network: NetworkId) => adapters[network];
And the component from before no longer knows anything about chains:
function PendingTxRow({ tx, network }: Props) {
const chain = adapterFor(network);
return (
<Row
label={tx.decoded.summary}
amount={chain.formatAmount(tx.amount, tx.asset)}
href={chain.explorerUrl({ tx: tx.id })} // undefined → the row shows "private"
/>
);
}
The whole architecture fits in one picture:
flowchart LR
UI["UI components<br/>tables · review screens · signing"] --> REG["Adapter registry<br/>adapterFor(network)"]
REG --> EVM["EVM adapter<br/>viem · ABI decoding · ERC-20"]
REG --> MOVE["Move adapter (IOTA)<br/>module types · command blocks"]
REG --> SOL["Solana adapter<br/>mint accounts · instructions"]
REG --> CAN["Canton adapter<br/>Daml parties · private views"]
EVM --> RPC1["EVM RPC + indexer"]
MOVE --> RPC2["IOTA RPC + indexer"]
SOL --> RPC3["Solana RPC"]
CAN --> RPC4["Canton participant APIs"]
The interface is deliberately small. Four methods cover almost everything the console shows. The temptation with adapters is to keep adding methods until the interface is a copy of every chain’s SDK; I held the line at “what does the UI actually need to render”.
Network-first state
The adapter fixed how we talk to chains. The next problem was what we remembered about them.
Our Zustand stores had grown up around a single idea of “the wallet”: one set of pending transactions, one set of balances, one cache. With one chain, that is fine. With several, it causes subtle bugs. Switch networks at the wrong moment and you can briefly show one chain’s pending proposals under another chain’s header. For a console where people approve real transactions, that is not a cosmetic issue.
I restructured the stores so that state is keyed by network, not held globally:
type NetworkState = {
pending: PendingTx[];
lastSyncedAt?: number;
};
const createNetworkStore = (network: NetworkId) =>
create<NetworkState>()(
persist(() => ({ pending: [] }), {
name: `console:${network}`,
storage: createJSONStorage(() => idbStorage),
}),
);
Each network gets its own store and its own persisted record. Two decisions mattered here:
- No data can leak between chains. A component reading IOTA state literally cannot see Ethereum state; there is no shared object to read from by mistake.
- IndexedDB instead of localStorage. Decoded transactions and token metadata add up quickly across several networks, and localStorage is small and synchronous. IndexedDB gives us room and keeps writes off the main thread. It also lets us clear the cache one network at a time, which turned out to be the most useful operational feature of the whole change: when one chain’s indexer has a bad day, we reset that network without touching the others.
The trade-off is that IndexedDB is asynchronous, so the first render has to cope with state that has not loaded yet. I handled that once, in the store layer, rather than in every component.
Decoding transactions for people
In a multisig console, the review screen is the product. A signer is about to approve something that moves real assets, and “Contract call, 0x8f3a…” is not an acceptable description.
So decodeTransaction() is not just parsing; its job is to produce something a person can review:
- Raw calldata becomes actions. On EVM, the adapter decodes the function and arguments with viem (
decodeFunctionData) and maps known functions to plain summaries: “Mint 10,000 tokens to 0x12…ab” instead of a hex blob. On IOTA, the adapter walks the command block and describes each step; on Solana it does the same for each instruction; on Canton it describes the contract action and the parties it affects. - Reverts become messages. When a simulation or execution fails, the adapter decodes the revert data (
decodeErrorResulton EVM) and maps known errors to plain language: “This investor has not passed identity verification” instead of an error selector. - Unknowns stay honest. If something cannot be decoded, the UI says so clearly and shows the raw data. A confident wrong summary is worse than an honest “unrecognised call”.
Because all of this lives in the adapters, every screen that shows a transaction gets the same, tested description for free.
What it made possible
The most important result is structural: adding a chain now means writing one adapter and adding it to the registry, not editing dozens of components. Features are built once against the interface and work on every supported network.
The console today supports multiple EVM chains plus IOTA, Solana and Canton through the same screens, the same review flow and the same components. Bugs that used to show up as “works on Ethereum, broken on the other chain” mostly disappeared, because there is no longer a second copy of the logic to drift.
Lessons and trade-offs
The pattern paid for itself, but it is not free, and it has gaps.
- Wait for the second implementation before abstracting. I did not design the interface up front. I designed it once a real second chain forced the question, which is why it stayed small. Abstracting around one example usually encodes that example’s quirks as “the way things work”.
- The interface hides real differences, sometimes too well. Chains differ in more than formatting: simulation support, fee models, finality and multisig mechanics all vary. Canton made this very concrete: a privacy-first ledger simply does not have the same public footprint as Ethereum. When a feature only exists on some families, I prefer an explicit capability flag (
chain.supports("simulation"),chain.supports("publicExplorer")) over pretending every chain can do everything. - Decoding needs data, not just code. Readable summaries depend on ABIs, module metadata and error catalogues. That registry of known contracts and errors became its own piece of infrastructure to maintain.
- Async persistence has a cost. Moving to IndexedDB meant handling loading states and migrating existing users off localStorage. It was worth it, but it was real work.
- What I would do differently: write adapter contract tests from day one, one shared test suite that every adapter must pass, so a new chain proves it behaves before it ships, instead of finding gaps in review.
The broader lesson is the one I keep coming back to as a senior engineer: the hard part of multi-chain is not any single chain. It is keeping the number of chains from leaking into every decision. Put the differences behind one boundary, keep that boundary small, and let the rest of the product forget which chain it is on.