Skip to Content

EVMWatcherCallbacks

Defined in: satellite-evm/src/utils/createEVMConnectionsWatcher.ts:19 

Store state and actions used by createEVMConnectionsWatcher. Pass the store’s disconnect and updateActiveConnection and its getState, so the watcher always reads the current state. Instead of getState you can pass the current activeConnection and connectionError; they are then read once, when the watcher is created.

Properties

activeConnection?

optional activeConnection?: EVMConnection

Defined in: satellite-evm/src/utils/createEVMConnectionsWatcher.ts:21 

The active connection when the watcher is created. Ignored when getState is passed.


connectionError?

optional connectionError?: string | TuwaErrorState

Defined in: satellite-evm/src/utils/createEVMConnectionsWatcher.ts:32 

The store’s connectionError when the watcher is created. While it is set, wallet changes are not copied to the store. Ignored when getState is passed.


disconnect

disconnect: (connectorType) => void

Defined in: satellite-evm/src/utils/createEVMConnectionsWatcher.ts:27 

Disconnects a connection; the store’s disconnect.

Parameters

connectorType

ConnectorType

The connector to disconnect.

Returns

void


getState?

optional getState?: () => object

Defined in: satellite-evm/src/utils/createEVMConnectionsWatcher.ts:45 

Returns the current store state, for example the store’s getState. The watcher calls it when it starts and on every wagmi event, so it does not have to be recreated when the active connection or the error changes.

Returns

The current activeConnection and connectionError.

activeConnection?

optional activeConnection?: EVMConnection

The active connection.

connectionError?

optional connectionError?: string | TuwaErrorState

The connection error.


updateActiveConnection

updateActiveConnection: (connection) => void

Defined in: satellite-evm/src/utils/createEVMConnectionsWatcher.ts:38 

Merges fields into the active connection; the store’s updateActiveConnection.

Parameters

connection

Partial<EVMConnection>

Fields to merge.

Returns

void

Last updated on