Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@dashevo/wallet-lib
Advanced tools
A pure and extensible JavaScript Wallet Library for Dash
Warning: This library should only be used in production when connected to trusted nodes. Although it provides easy access to wallet functionality without requiring a full node, it does not verify synchronized blockchain data (e.g., the masternode list, InstantSend transactions, ChainLocks) or check transactions against block headers.
Dash is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Dash network allows for highly resilient Dash infrastructure, and the developer community needs reliable, open-source tools to implement Dash apps and services.
In order to use this library, you will need to add it to your project as a dependency.
Having NodeJS installed, just type in your terminal :
npm install @dashevo/wallet-lib
For browser usage, you can also directly rely on unpkg. Below, we also assume you use localForage as your persistence adapter.
<script src="https://unpkg.com/@dashevo/wallet-lib"></script>
<script src="https://unpkg.com/localforage"></script>
const wallet = new Wallet({adapter: localforage});
In your file, where you want to execute it :
const { Wallet, EVENTS } = require('@dashevo/wallet-lib');
const wallet = new Wallet();
// We can dump our initialization parameters
const mnemonic = wallet.exportWallet();
// Hook on headers and TX sync progress events
wallet.on(EVENTS.HEADERS_SYNC_PROGRESS, (progressInfo) => {
const {
confirmedProgress,
totalProgress,
confirmedSyncedCount,
totalSyncedCount,
totalCount
} = progressInfo;
})
wallet.on(EVENTS.TRANSACTIONS_SYNC_PROGRESS, (progressInfo) => {
const {
progress,
syncedBlocksCount,
totalBlocksCount,
transactionsCount
} = progressInfo;
})
wallet.getAccount().then((account) => {
// At this point, account has fetch all UTXOs if they exists
const balance = account.getTotalBalance();
console.log(`Balance: ${balance}`);
// We easily can get a new address to fund
const { address } = account.getUnusedAddress();
});
Wallet will by default connects to DAPI and use either localforage (browser based device) or a InMem adapter. Account will by default be on expected BIP44 path (...0/0).
Insight-Client has been removed from MVP and is not working since Wallet-lib v3.0.
You can see some examples here.
More extensive documentation is available at https://dashpay.github.io/platform/Wallet-library/ along with additional examples & snippets.
Wallet-Lib is maintained by the Dash Core Developers. We want to thank all members of the community that have submitted suggestions, issues and pull requests.
Feel free to dive in! Open an issue or submit PRs.
MIT © Dash Core Group, Inc.
FAQs
Light wallet library for Dash
We found that @dashevo/wallet-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.