Accessing Products
Get product informations and access them
Get Product
Access all product information via 2 calls getProducts & getProduct, the first will give you access to all products ids available in an array, where the second will give you access to a specific information based on that productId, returning info as shown below
/* Get All products */
let products = await stakingContract.getProducts();
/* Create Product Info */
let res = await stakingContract.getProduct({
product_id : products[0] // Id
});
console.log(res);
/**
* @function getProduct
* @returns {Date} createdAt
* @returns {Date} startDate
* @returns {Date} endDate
* @returns {Integer} totalMaxAmount
* @returns {Integer} individualMinimumAmount
* @returns {Integer} APR
* @returns {Integer} currentAmount
* @returns {Boolean} lockedUntilFinalization
* @returns {Array | Address} subscribers
* @returns {Array | Integer} subscriptionIds
*/
Updated almost 4 years ago