Check if user is a payed subscriber

It is easy with sub2 SDK to check whether a user is subscribed to a given recipient. We can simply use the isPayedSubscriber function:

const isPayedSubscriber: boolean = await sub2SDK.isPayedSubscriber(
    senderAddress, 
    recipientAddress, 
    minAmount, 
    token, 
    cooldown
);

This function will return true only if there is an active paid subscription from senderAddress to recipientAddress with minimum minAmount of token and cooldown of cooldown.

Note: This only counts paid subscriptions, meaning subscriptions that have performed at least one payment. Thus, subscriptions on the initial delay before the first payment will not count.

Last updated