
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@edenjs/balance
Advanced tools
[](https://travis-ci.com/eden-js/balance) [](https://github.com/eden-js/balance/issues) [;
// get first entry
const entry = await BalanceEntry.findOne();
// data used in frontend
const data = await entry.sanitise();
balance.change Usage UsageBalance change hook allows us to prevent/change a balance transaction on a user based on parameters.
this.eden.pre('balance.change', (data) => {
// extract variables
const { user, direction, amount, payment, current } = data;
// prevent balance change by setting prevent : true
data.prevent = true;
data.complete = true;
});
balance UsageBalance helper applies balance changes to users automatically.
// user model
const User = model('user');
// balance helper
const balanceHelper = helper('balance');
const balanceUser = await User.findOne();
const didAdd = await balanceHelper.add(balanceUser, 10); // add 10 to users account
const didSubtract = await balanceHelper.subtract(balanceUser, 10); // subtract 10 from users account
FAQs
[](https://travis-ci.com/eden-js/balance) [](https://github.com/eden-js/balance/issues) [
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.