The CodeSandbox in the demo video showing "Followers" and "Followings" was created by CyberConnect and embedded at this link: https://docs.cyberconnect.me/get-started/read-connections/#sandbox
To detemine which contacts fit into which filter category, I referenced the GraphQL code here: https://docs.cyberconnect.me/cyberconnect-api/graphql-api/connections/#fetch-followstatus-example
The "Follow" button is defined at https://github.com/georgefane/ETHchat/blob/main/components/CyberConnect/FollowButton.tsx, and is based on the code here: https://docs.cyberconnect.me/get-started/create-a-connection/#sandbox
The dropdown to select a filter is defined in this file https://github.com/georgefane/ETHchat/blob/v2/components/CyberConnect/MyListbox.tsx and is based on the top example here: https://headlessui.dev/react/listbox
Fork this repo and import into Vercel (tutorial).
This example chat application demonstrates the core concepts and capabilities of the XMTP Client SDK. It is built with React, Next.js, and the xmtp-js
client library. The application is capable of sending and receiving messages via the XMTP Labs development network, with no performance guarantees and notable limitations to its functionality.
It is maintained by XMTP Labs and distributed under MIT License for learning about and developing applications that utilize the XMTP decentralized communication protocol.
All wallets and messages are forcibly deleted from the development network on Mondays.
The XMTP protocol is in the early stages of development. This software is being provided for evaluation, feedback, and community contribution. It has not undergone a formal security audit and is not intended for production applications. Significant breaking revisions should be expected.
Add your Infura ID to .env.local
in the project's root.
NEXT_PUBLIC_INFURA_ID={YOUR_INFURA_ID}
If you do not have an Infura ID, you can follow these instructions to get one.
This example comes preconfigured with an Infura ID provided for demonstration purposes. If you plan to fork or host it, you must use your own Infura ID as detailed above.
npm install
npm run dev
Open https://localhost:3000 with your browser to see the application.
Web3Modal
is used to inject a Metamask, Coinbase Wallet, or WalletConnect provider through ethers
. Methods for connecting and disconnecting are included in WalletContext alongside the provider, signer, wallet address, and ENS utilities.
In order to use the application's chat functionality, the connected wallet must provide two signatures:
- A one-time signature that is used to generate the wallet's private XMTP identity
- A signature that is used on application start-up to initialize the XMTP client with that identity
The application utilizes the xmtp-js
Conversations abstraction to list the available conversations for a connected wallet and to listen for or create new conversations. For each convesation, it gets existing messages and listens for or creates new messages. Conversations and messages are kept in a lightweight store and made available through XmtpContext alongside the client and its methods.
The application's functionality is limited by current work-in-progress on the xmtp-js
client.
The client will throw an error when attempting to lookup an address that does not have an identity broadcast on the XMTP network.
This limitation will be mitigated very soon by the example application's UI, and resolved soon via improvements to the xmtp-js
library that will allow messages to be created even if the intended recipient has not yet generated its keys.