Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@bitgo-beta/unspents
Advanced tools
Defines the chain codes used for different unspent types and methods to calculate bitcoin transaction sizes
The package provides a Dimensions
class with methods to calculate bitcoin transaction sizes
npm install --save @bitgo/unspents
The transaction vSize is critical to calculating the proper transaction fee.
The class unspents.Dimensions
provides a class that helps work with the components required
to calculate an accurate estimate of a transaction vSize.
import { Codes, Dimensions } from '@bitgo/unspents';
// using raw attributes
new Dimensions({
nP2shInputs: 1,
nP2shP2wshInputs: 1,
nP2wshInputs: 1,
outputs: { count: 1, size: 32 },
});
// calculate from unspents that have `chain` property (see Chain Codes)
Dimensions.fromUnspents(unspent[0]);
Dimensions.fromUnspents(unspents);
// Signed inputs work too
Dimensions.fromInput(inputs[0]);
Dimensions.fromInputs(inputs);
// Transaction outputs
Dimensions.fromOutputs(outputs[0]);
Dimensions.fromOutputs(outputs);
Dimensions.fromOutputOnChain(Codes.p2sh.internal);
Dimensions.fromOutputScriptLength(31);
// Combining dimensions and estimating their vSize
Dimensions.fromUnspents({ unspents })
.plus(Dimensions.fromOutputOnChain(Codes.p2shP2wsh.internal).times(nOutputs))
.getVSize();
Publishing new versions should be done by running the publish script in scripts/publish.sh
.
It can be invoked with the name of the branch to release, and will default to the currently checked out branch if not given.
It will perform validation of all prepublish conditions, run a dry-run publish, then, if successful, a real publish. After that is complete,
the newly installed package will be downloaded and require()
'd to ensure the package was published correctly.
@bitgo/unspents
uses Drone for continuous integration, which is configured by the .drone.yml
file in the project root. However, this file should not be modified by hand. All changes to the CI process should be done by modifying the .drone.jsonnet
file, then running npm run generate_drone
to rebuild the .drone.yml
file.
Codes
The exported Codes
module is now deprecated.
Please use utxo-lib/src/bitgo/wallet/chains
instead.
FAQs
Defines the chain codes used for different unspent types and methods to calculate bitcoin transaction sizes
We found that @bitgo-beta/unspents 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.