Chat With Owner
Many dApps wish to enable and encourage two owners to interact and discuss a swap or sale. WalletChat chat-with-owner feature enables this use case:
Chat With Owner
To implement a "Chat With Owner" type feature as demonstrated at nft.walletchat.fun :
Ensure your NPM package is up to date
yarn upgrade react-wallet-chat
Import the ChatWithOwner button:
import { ChatWithOwner } from 'react-wallet-chat'
The owner address is the message recipient, and is set via the ownerAddress parameter. Here is a code snipped to render a Chat WIth Owner button and the underlying functionality:
{ && (
<ChatWithOwner
ownerAddress=
render={<Button css={buttonCss} color="gray3" />}
/>
)}
Add the following to the main App code, in this case the activeConnector is from the WAGMI package, and could be substituted as needed to get the wallet name/type.
<WalletChatProvider>
<WalletChatWidget
connectedWallet={
address && activeConnector && chainId
? {
walletName: activeConnector.name,
account: address,
chainId: chain.id,
}
: undefined
}
/>
</WalletChatProvider>
Last updated