Skip to content

Instantly share code, notes, and snippets.

@elraphty
Created March 23, 2022 00:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save elraphty/5c1e25200d4a55b53600cd1b8ab392d2 to your computer and use it in GitHub Desktop.
import { api, utils, NotificationItem } from "@epnsproject/frontend-sdk"
// Define the variables required to make a request
const walletAddress = "0x1234567890abcdcdefghijklmnopqrstuvwxyz123";
const pageNumber = 1;
const itemsPerPage = 20;
// Fetch the notifications
const fetchedNotifications = await api.fetchNotifications(walletAddress, itemsPerPage, pageNumber)
console.log(fetchedNotifications);
// Parse the notification fetched
const parsedResponse = utils.parseApiResponse(fetchedNotifications.results);
console.log(parsedResponse);
// This is used to render the text present in a notification body as a JSX element
<NotificationItem
notificationTitle="NOTIFICATION TITLE"
notificationBody="NOTIFICATION BODY EXAMPLE"
cta="www.cta.com"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment