
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
coins-manager
Advanced tools
Source code of [coins manager](https://www.npmjs.com/package/coins-manager)
Source code of coins manager
This manager can be configured for a global usage or to split economy servers.
This manager works with MySQL.
Here is how to use the manager
First install the package (yarn add coins-manager, npm i coins-manager or pnpm add coins-manager)
Typescript initialisation
import { CoinsManager } from 'coins-manager';
import { createConnection } from 'mysql';
const database = createConnection({/* database informations */})
const manager = new CoinsManager<'global' | 'multiguild'>(database, {
options: 'global' | 'multiguild'
});
manager.start();
Javascript initialisation
const { CoinsManager } = require('coins-manager');
const { createConnection } = require('mysql');
const database = createConnection({/* database informations */})
const manager = new CoinsManager<'global' | 'multiguild'>(database, {
options: 'global' | 'multiguild'
});
manager.start();
The manager return this format :
{
coins: number;
bank: number;
user_id: string;
}
And if it's set to a multiguild usage :
{
guild_id: string;
user_id: string;
coins: number;
bank: number;
}
Here are the documentation for the methods
Remember that if you set it on a multiguild usage, it will require a guild_id parameter
Add coins to an user
manager.addCoins({
user_id: '1234',
coins: 100
// Optional guild_id: '4321' value is required for a multiguild usage
});
Remove coins to an user
manager.removeCoins({
user_id: '1234',
coins: 100
// Optional guild_id: '4321' value is required for a multiguild usage
});
Add bank amount to an user
manager.addBank({
user_id: '1234',
bank: 100
// Optional guild_id: '4321' value is required for a multiguild usage
});
Remove coins in bank from an user
manager.removeBank({
user_id: '1234',
bank: 100
// Optional guild_id: '4321' value is required for a multiguild usage
});
This method returns the leaderboard of coins + bank
manager.getLeaderboard();
If you set it to a multiguild usage, you can add guild_id parameter to get the leaderboard of a specific server
manager.getLeaderboard('4321');
Get the data of an user
manager.getData({
user_id: '1324'
});
If you set it to a multiguild usage, you have to add the guild_id paramter :
manager.getData({
user_id: '1324',
guild_id: '4321'
});
The manager's cache works with a code system, in a global usage it's just the user ID, but if you set it to a multiguild usage, you maybe want to get the code of the user, so use :
manager.getCode({
user_id: '1234'
})
And for multiguild usage :
manager.getCode({
user_id: '1324',
guild_id: '4321'
});
This method is used to know if a user is in the database
manager.hasAccount({
user_id: '1324'
});
// Boolean
And on a multiguild usage :
manager.hasAccount({
user_id: '1234',
guild_id: '4321'
});
// Boolean
Here are the proprety of the manager : array
This get method returns you an array with all the returns data
FAQs
Source code of [coins manager](https://www.npmjs.com/package/coins-manager)
The npm package coins-manager receives a total of 8 weekly downloads. As such, coins-manager popularity was classified as not popular.
We found that coins-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.