-
Notifications
You must be signed in to change notification settings - Fork 26
W3iProxy
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.
All the files relating to the proxy are found under src/w3iProxy
.
W3i Proxy has a few main components that manage its data, coming in from external and/or internal sources.
- Proxy Index
- Facades
- Providers
- Communicators
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.
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
:
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.
There are 4 communicators in w3i, they are what enables communication with outside sources. The current communicators are: