@0xsequence/oms-wallet-wagmi-connector package adapts an active TypeScript OMS Wallet SDK client to wagmi’s connector API. Use it when your React app already uses wagmi hooks for account state, signing, chain switching, or transaction submission.
The connector does not render authentication UI. Authenticate with @0xsequence/typescript-sdk first, then connect through wagmi after the OMS Wallet session has an active wallet address.
Install
Install the TypeScript SDK, the wagmi connector package, wagmi, viem, and TanStack Query for wagmi React hooks.Create The Wagmi Config
Create oneOMSClient, pass it to omsWalletConnector, and configure wagmi chains with viem transports. Wagmi chain definitions are separate from OMS Wallet Network entries, so pass both the wagmi chains and the OMS networks.
| Parameter | Type | Description |
|---|---|---|
client | OmsWalletClientLike or function | OMSClient instance, or a function that resolves one. |
networks | Network[] or undefined | OMS Wallet networks used to validate connector chains. Defaults to client.supportedNetworks when available. |
initialChainId | number or undefined | Initial wagmi chain ID. Must exist in wagmi chains and the OMS networks list. |
transactionOptions | OmsWalletTransactionOptions or function | Static transaction options, or a resolver called for each wagmi transaction request. |
id | string or undefined | Optional connector ID. Defaults to omsWallet. |
name | string or undefined | Optional connector display name. Defaults to OMS Wallet. |
icon | string or undefined | Optional connector icon URL or data URI. |
omsWalletConnector.
Wrap The React App
Pass the samewagmiConfig to WagmiProvider. Wagmi React hooks also require a TanStack Query client.
Connect After OMS Auth
Authenticate with the OMS Wallet SDK before calling wagmiconnect. The connector checks oms.wallet.walletAddress and rejects the connection if there is no active wallet session.
Disconnect And Sign Out
Wagmidisconnect only disconnects wagmi state. It does not sign out the OMS Wallet SDK session.
connect again.
Configure Fee Options
Wagmi transaction parameters do not include OMS fee-option preferences. UsetransactionOptions on the connector to apply fee selection to wagmi transactions.
selectFeeOption after preparing the transaction. The selector receives FeeOptionWithBalance[], including each fee option and wallet balance data when available. Use FeeOptionSelector.firstAvailable to choose the first option the wallet can pay, or return option.selection from a custom selector.
Send Transactions With Wagmi
Use wagmi transaction APIs after connecting. The connector always waits for an EVM transaction hash because wagmisendTransaction must return a hash.
from, to, value, data, and chainId. The to field is required, so contract deployment is not supported through this connector.
The connector ignores wallet-managed execution fields that OMS Wallet does not accept through this path: gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, type, and accessList. Unknown transaction fields are rejected.
waitForStatus: false is not supported through the connector. Use oms.wallet.sendTransaction directly when you need the OMS transaction ID before an EVM transaction hash is available.
Provider Scope
Use the connector through wagmi APIs. Do not treatgetProvider() as a general RPC provider.
Supported provider methods are limited to wallet operations that map to the SDK:
| Method | Use |
|---|---|
eth_accounts | Read the active OMS Wallet account. |
eth_requestAccounts | Connect the active OMS Wallet session. |
wallet_switchEthereumChain | Switch across configured wagmi chains that OMS Wallet supports. |
personal_sign | Sign string messages. |
eth_signTypedData_v4 | Sign typed data. |
eth_sendTransaction | Send a transaction through OMS Wallet. |
wallet_sendTransaction | Send a transaction through OMS Wallet. |
wallet_getCapabilities | Returns no capabilities unless OMS Wallet adds capability support. |
eth_call, eth_estimateGas, eth_getBalance, eth_getCode, eth_getTransactionCount, eth_getTransactionReceipt, and eth_blockNumber are not supported by the OMS Wallet provider. Use wagmi public transports for reads, or call oms.wallet directly for SDK operations.
Raw byte message signing is not supported because OMS Wallet signs string messages. Use personal_sign for messages and eth_signTypedData_v4 for typed data.