EIP-1193 and wagmi

WalletPair does not ship a wagmi connector or provider package. Implement the Ethereum protocol first, then expose its dApp-side transport through your own EIP-1193-compatible provider.

Provider contract

interface RequestArguments {
  readonly method: string
  readonly params?: readonly unknown[] | object
}

provider.request(args): Promise<unknown>
provider.on(event, listener): Provider
provider.removeListener(event, listener): Provider

Successful request() calls resolve to the method result itself. Failures reject with a ProviderRpcError containing the EIP-1193 numeric error code. Implement addListener as an alias of on and once for ecosystem compatibility; legacy send and sendAsync are out of scope.

Adapter responsibilities

  • Turn each provider call into the encrypted request envelope from the Ethereum protocol.
  • Route a response to its outstanding request ID and emit wallet events after local state updates.
  • Preserve the EIP-155 suffix for responses and select the new suffix for chainChanged.
  • Use a separately trusted RPC endpoint only for explicitly allowlisted read-only methods.
  • Expose the provider to wagmi using the normal custom-connector integration points in the wagmi version you use.

This separation keeps application-framework adapters out of the WalletPair wire protocol and avoids shipping a stale, incompatible SDK abstraction.