Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
abstract-bitcoin-wallet
Advanced tools
Interface and test suite for standardized bitcoin wallet libraries
Interface and test suite for standardized bitcoin wallet libraries. For creating your own compatible implementation, see Tests.
This package exposes a mockWallet method that implements the abstract-bitcoin-wallet interface and can be used to for mocking in tests.
es6
import { mockWallet } from 'abstract-bitcoin-wallet';
const wallet = mockWallet();
JavaScript
var wallet = require('abstract-bitcoin-wallet').mockWallet();
All methods must return promises.
Get wallet balance summary.
Example response:
{
balance:0,
confirmedBalance:0,
}
Send coins to an address.
address
address to send amount to
amount
amount to send in satoshis
Example response:
{
hash: 'txhash of the transaction',
}
label
(optional) label to assign address
Example response:
{
address: 'some bitcoin address',
}
Get information about address including balance
address
address to query
Get information about transaction
hash
hash of the transaction
Example response:
{ hash: '817845049ff457f6c52080ccb90705a8fbf64e7d683b841cdcb9607db207b929',
fee: 1661,
inputs:
[ { previousHash: '06c56b92d608b309aa3f930d74a57e50b2d58994dffa90f8393755b82ae41508',
previousOutputIndex: 0 } ],
outputs:
[ { vout: 0,
account: '2NGKTqNQyct4wctAyo8Wwy4zoFWkWXseaRo',
value: 74099,
isMine: true,
chain: 1,
chainIndex: 70 },
{ vout: 1,
account: '2MzaStGqVB4Qk4KJG8aA9Q2CLWHqBEr1euw',
value: 10000,
isMine: true,
chain: 0,
chainIndex: 1454 } ],
entries: [ { account: '2N4VLa3xQn4ucSQ475gME26v1UUE6hgrFDr', value: -1661 } ],
hex: '01000000010815e42ab8553739f890fadf9489d5b2507ea5740d933faa09b308d6926bc50600000000fdfd0000483045022100a473c9787d6bd87447fabb9067dc98d92e3d97c15ae9fb844d7dbdf4d4959b1c02205858f9a0aa7b7aa57295f5046c675f257106989194a086ffe67bd7a7e1b82d0d01473044022059210113a797174a4c5a4e465cd5855f68c990a8f2a446f8808b08d2827ac3fe02205695b023b33e3b85e81e80053b2481b09c4893978bb5f87e3392bcab4e887334014c695221028b2a45adfca1ddf2bbf2a3cb26749e11268877396867b95a41cc445aec52d6cf2103deb2c468cc3ef4e0bd444747ef842a7f2b735f837ca58947738f8fc438f9fc3c21027f071a58ac9987f2cf2b705638eeacd2196d226b6e126a5f42f341c2d100ef4c53aeffffffff02732101000000000017a914fd181d7d451b1762f63c8bdbc1fdceb69ff3ff6e87102700000000000017a914506b8c92c0ede36ccbd0cbd466e18e5d1ee86fc88700000000' }
To test your own implementation of the abstract-bitcoin-wallet interface, adapt the following code:
es6:
import walletTests from 'abstract-bitcoin-wallet';
import yourCustomWallet from './';
const wallet = yourCustomWallet({
someconfig: 'somevalue',
});
walletTests(wallet);
JavaScript:
var walletTests = require('abstract-bitcoin-wallet');
var yourCustomWallet = require('./');
var wallet = yourCustomWallet({ someconfig: 'somevalue' });
walletTests(wallet);
For verbose output, set DEBUG
to abw
, e.g: DEBUG=abw npm test
.
FAQs
Interface and test suite for standardized bitcoin wallet libraries
We found that abstract-bitcoin-wallet 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.