Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
bch-dex-lib
Advanced tools
An npm JavaScript library for browser and node.js that incorporates the SWaP protocol used by bch-dex.
This is a library for use in both browser and node.js JavaScript applications. It incorporates the basic SWaP protocol used by bch-dex.
The purpose of this library is build a web and Android app that can let Takers purchase tokens using the bch-dex protocol. Makers still still need to run the bch-dex back end to make Offers and accept Counter-Offers. But an app using this library allows Takers to issue a Counter Offer without needing to run back end software.
This library depends on minimal-slp-wallet and p2wdb. Both of these libraries must be instantiated and passed in as arguments when instantiating this library.
npm install --save-exact bch-dex-lib
async function start() {
try {
// Global npm libraries
const BchWallet = require('minimal-slp-wallet/index')
const { Read, Write } = require('p2wdb/index')
// Customize the two variables below for your own test. The mnemonic
// should control about $0.20 USD of BCH. The p2wdbHash should be for a
// valid Offer in the market.
const mnemonic = 'gaze result fortune pulse jeans lucky tape build maximum puppy urban size'
const p2wdbHash = 'zdpuAvWMYm7bfHTxbNwsWYmrkK3cnhtH2MzQ7QS74uYbkM3ja'
// Instantiate dependencies
const wallet = new BchWallet(mnemonic, { interface: 'consumer-api' })
await wallet.walletInfoPromise
const p2wdbRead = new Read()
const p2wdbWrite = new Write({ wif: wallet.walletInfo.privateKey, interface: 'consumer-api' })
// Instantiate the Take library.
const take = new Take({ wallet, p2wdbRead, p2wdbWrite })
// Generate a Counter Offer to take the other side of the trade expressed in the Offer.
const hash = await this.p2wdbWrite.postEntry(counterOfferData, offerData.appId)
console.log(`Counter Offer generated with P2WDB entry ${hash}`)
} catch(err) {
console.error(err)
}
}
start()
This open source software is developed and maintained by the Permissionless Software Foundation. If this library provides value to you, please consider making a donation to support the PSF developers:
bitcoincash:qqsrke9lh257tqen99dkyy2emh4uty0vky9y0z0lsr
FAQs
An npm JavaScript library for browser and node.js that incorporates the SWaP protocol used by bch-dex.
We found that bch-dex-lib 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.