Accessing Subscriptions
Access all Address Subscriptions as well specific information
Get Subscriptions By Address
Access all Subscriptions filtered by the subscriber address
let res = await stakingContract.getSubscriptionsByAddress({address : /* address */});
console.log(res[0]) // subscriptionId
Get Subscription
Access all Subscription information by Id
let res = await stakingContract.getSubscription({
subscription_id : //subscriptionId,
product_id : //productId
});
/**
* @function getSubscription
* @description Get Subscription
* @param {Integer} product_id
* @param {Integer} subscription_id
* @returns {Integer} _id
* @returns {Integer} productId
* @returns {Date} startDate
* @returns {Date} endDate
* @returns {Address} subscriberAddress
* @returns {Integer} APR
* @returns {Boolean} finalized
*/
finalized
The boolean returned on Get Subscription shows if the subscription was withdrawn or not
Updated almost 4 years ago