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.
Type Parameters
Section titled “Type Parameters”Ext = object
Properties
Section titled “Properties”events
Section titled “events”events:
string[]
Wallet events proposed for this namespace.
extend?
Section titled “extend?”
optionalextend?: (ctx) =>Ext
Adds namespace-specific getters or methods to the provider.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Ext
handle?
Section titled “handle?”
optionalhandle?: (req,ctx) =>Promise<unknown> |unknown
Handles a supported request, or returns undefined so another adapter may handle it.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<unknown> | unknown
methods
Section titled “methods”methods:
string[]
Wallet methods proposed for this namespace.
namespace
Section titled “namespace”namespace:
string
CAIP-2 namespace, for example "eip155" or "solana".
onDisconnect?
Section titled “onDisconnect?”
optionalonDisconnect?: () =>void
Clears adapter-owned state after disconnection.
Returns
Section titled “Returns”void
onEvent?
Section titled “onEvent?”
optionalonEvent?: (name,data,chainId,ctx) =>void
Maps a session event to adapter state and public provider events.
Parameters
Section titled “Parameters”string
unknown
chainId
Section titled “chainId”string | undefined
Returns
Section titled “Returns”void
onSettle?
Section titled “onSettle?”
optionalonSettle?: (session,ctx) =>void
Updates adapter state after a session is approved or restored.
Parameters
Section titled “Parameters”session
Section titled “session”Returns
Section titled “Returns”void