Manage balance

Here, you get to knpw how to to get balance, add Balance and estimate balance required for a SkyID.

To estimate the balance required to run SkyID. Implement this code:

const resp = await skynet.dripRateManager.estimateBalance(contractAppList, timeInSeconds);
if(!resp.success) return;
const subBalEstimate = resp.data;

To add subscription credit to the balance required to run a SkyID, implement this code:

const subCredResp = await skynet.dripRateManager.addSubscriptionCredit(nftID, subBalEstimate);
if(!subBalResp.success) return;
const {subBalEstimate} = subBalResp.data;

To get the balance available for a SkyID, implement this code:

const getBalance = await skynet.dripRateManager.getBalanceForSubscription(nftId);

Last updated