Skip to content

ChainAdapter

ChainAdapter<Ext> = object

Behavior shared by every configured chain in a namespace.

handle returns undefined when the adapter does not own a method. Any other value, including null, is the final result. extend may add namespace-specific properties to the provider.

Ext = object

events: string[]

Wallet events proposed for this namespace.


optional extend?: (ctx) => Ext

Adds namespace-specific getters or methods to the provider.

Ctx

Ext


optional handle?: (req, ctx) => Promise<unknown> | unknown

Handles a supported request, or returns undefined so another adapter may handle it.

RpcRequest

Ctx

Promise<unknown> | unknown


methods: string[]

Wallet methods proposed for this namespace.


namespace: string

CAIP-2 namespace, for example "eip155" or "solana".


optional onDisconnect?: () => void

Clears adapter-owned state after disconnection.

void


optional onEvent?: (name, data, chainId, ctx) => void

Maps a session event to adapter state and public provider events.

string

unknown

string | undefined

Ctx

void


optional onSettle?: (session, ctx) => void

Updates adapter state after a session is approved or restored.

Session

Ctx

void