Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 723 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 723 Bytes

service-provider.js

A work-in-progress typescript client library for the Reddit service provider.

Basic usage:

const serviceProvider = new Provider(SERVICE_PROVIDER_URL);

const response = await serviceProvider.isUserSubscribed(userWallet.address(), COMMUNITY_NAME);

if (response.subscribed) {
    console.log(`User is subscribed to the community ${COMMUNITY_NAME}.`);
    console.log(`Subscription start: ${response.startedAt}. Subscription expires: ${response.expiresAt}`);
} else {
    console.log(`User is not subscribed to the community ${COMMUNITY_NAME}.`);
}

A more verbose real-life usage example can be found at the service-provider-test.ts script.