Skip to content

Instantly share code, notes, and snippets.

@elraphty
Created Mar 23, 2022
Embed
What would you like to do?
import {channels} from '@epnsproject/frontend-sdk-staging';
import {ethers} from 'ethers';
import Web3Modal from 'web3modal';
const web3Modal = new Web3Modal();
const connection = await web3Modal.connect();
const provider = new ethers.providers.Web3Provider(connection);
const signer = provider.getSigner();
const epnsSubscribe = async () => {
await channels.optIn(
signer,
channelAddress,
chainId,
userAddress,
{
onSuccess: () => // do something after success
}
);
};
const epnsUnSubscribe = async () => {
await channels.optOut(
signer,
channelAddress,
chainId,
userAddress,
{
onSuccess: () => // do something after success
}
)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment