Skip to content

W3iProxy

Celine Sarafa edited this page May 22, 2023 · 2 revisions

W3i Proxy

This is the central state provider for all of web3inbox, there is some bits state that may come in from outside the proxy, but that is typically state unrelated to its central features. Currently supporting Chat and Notify.

Location

All the files relating to the proxy are found under src/w3iProxy.

Components

W3i Proxy has a few main components that manage its data, coming in from external and/or internal sources.

  1. Proxy Index
  2. Facades
  3. Providers
  4. Communicators

Proxy Index

The proxy index is one file src/w3iProxy/index.ts which essentially just inits the facades and passes the provider ID to said facades. This index is a singleton and is also what is actually being called when accessing it through the window.web3inbox object. Hence, it conveniently exposes the facades within it, Eg: window.web3inbox.chat to access the chat facade.

Facades

The facades within web3inbox are essentially "proxies" that provide data and Observables on demand. For facades centered around a WalletConnect API, (Eg chat), they provide an almost identicle replica of the API and cover the spec.

There are currently 3 Facades within w3iProxy:

  1. Chat
  2. Push
  3. Auth

Providers

For each facade, there are 2 providers. One external, one internal. True to their name, the internal provider manages state internally. For example, in the case push, the internal provider manages the JS push client to get data about active subscriptions and other state. In the case of the external provider, all state comes from external sources through Communicators.

Communicators

There are 4 communicators in w3i, they are what enables communication with outside sources. The current communicators are:

  1. JsCommunicator
  2. iOSCommunicator
  3. ReactNativeCommunicator
  4. AndroidCommunicators
Clone this wiki locally