npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cexdb

v0.0.4

Published

Allows you to create hd wallets and store data on connected db

Downloads

5

Readme

npm i cexdb
const cex = require("cex")

// Takes in a wallet name that will be stored on the db and create BTC mnemonics
// return false if walletname already exist
cex.createBTCHdWallet(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Takes in a wallet name that will be stored on the db and create ETH mnemonics
// return false if walletname already exist
cex.createETHHdWallet(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)


// Takes in a wallet name that will be stored on the db and create BSC mnemonics
// return false if walletname already exist
cex.createBSCHdWallet(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Takes in a wallet name that was stored on the db and generate BTC wallet address.
// return false if walletname doesnt exist
// returns BTC wallet address, it private key
cex.generateBTCAddress(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Takes in a wallet name that was stored on the db and generate ETH wallet address.
// return false if walletname doesnt exist
// returns BTC wallet address, it private key
cex.generateETHAddresses(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Takes in a wallet name that was stored on the db and generate BSC wallet address.
// return false if walletname doesnt exist
// returns BTC wallet address, it private key

cex.generateBSCAddresses(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get metadata for a particular address
//all data relevant for using this address..
cex.getAddressMeta(pipeline, address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// get all wallet ON btc
cex.getAllBTCWallets().then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// get all wallet ON eth
cex.getAllETHWallets().then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// get all wallet ON BSC
cex.getAllBSCWallets().then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// transfer currencies
// pipeline : if "ETH" then it will transfer ETHER in Ethereum network
//          if "BSC" then it will transfer BNB in Binance smartchain network
//          if "BTC" then it will transfer BTC in Bitcoin Network
// sender address
// receiever address
// amount
// IF SENDER ADDRESS DOESNT EXIST, RETURN FALSE.
// // TransferBtc("ETH", "0x4BF815Ef22628bFe3988B16fC5819B0262C3d3A6", "0xC655114468c3a7bdCF7457c91cb5ab541e528Bf8", 15);
cex.Transfer(pipeline, senderAddress, recieverAddress, amount).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// transfer USDT in both Ethereum and Binance network 
// pipeline : if "ETH" then it will transfer USDT in Ethereum network
//          if "BSC" then it will transfer USDT in Binance smartchain network
// sender address
// receiever address
// amount
// IF SENDER ADDRESS DOESNT EXIST, RETURN FALSE.
// // TransferBtc("ETH", "0x4BF815Ef22628bFe3988B16fC5819B0262C3d3A6", "0xC655114468c3a7bdCF7457c91cb5ab541e528Bf8", 15); 
cex.TransferUSDT(pipeline, senderAddress, recieverAddress, amount).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// transfer BTC in both Ethereum and Binance network 
// pipeline : if "ETH" then it will transfer USDT in Ethereum network
//          if "BSC" then it will transfer USDT in Binance smartchain network
// sender address
// receiever address
// amount
// IF SENDER ADDRESS DOESNT EXIST, RETURN FALSE.
// // TransferBtc("ETH", "0x4BF815Ef22628bFe3988B16fC5819B0262C3d3A6", "0xC655114468c3a7bdCF7457c91cb5ab541e528Bf8", 15); 
cex.TransferBTC(pipeline, senderAddress, recieverAddress, amount).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// transfer ETH in Binance network 
// sender address
// receiever address
// amount
// IF SENDER ADDRESS DOESNT EXIST, RETURN FALSE.
// // TransferBtc("ETH", "0x4BF815Ef22628bFe3988B16fC5819B0262C3d3A6", "0xC655114468c3a7bdCF7457c91cb5ab541e528Bf8", 15); 
cex.TransferETHOnBSC(senderAddress, recieverAddress, amount).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// transfer BNB in ETHEREUM network 
// sender address
// receiever address
// amount
// IF SENDER ADDRESS DOESNT EXIST, RETURN FALSE.
// // TransferBtc("ETH", "0x4BF815Ef22628bFe3988B16fC5819B0262C3d3A6", "0xC655114468c3a7bdCF7457c91cb5ab541e528Bf8", 15); 
cex.TransferBNBOnETH(senderAddress, recieverAddress, amount).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

//Get the Balance on a particular address
// Verify/Specify that input address is BTC address
cex.getBTCAddressBalance(address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

//Get the Balance on a particular address
// Verify/Specify that input address is ETH address
cex.getETHAddressBalance(address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

//Get the Balance on a particular address
// Verify/Specify that input address is BSC address
cex.getBSCAddressBalance(address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)


// Delete address from a wallet
cex.deleteAddressFromBTCWallet(address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Delete address from a wallet
cex.deleteAddressFromBSCWallet(address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Delete address from a wallet
cex.deleteAddressFromETHWallet(address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Delete Wallet_Name completely from the server
// name of wallet to destroy
cex.destroyBTCHdWallet(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Delete Wallet_Name completely from the server
// name of wallet to destroy
cex.destroyETHHdWallet(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Delete Wallet_Name completely from the server
// name of wallet to destroy
cex.destroyBSCHdWallet(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)
//

// return associated details with the wallet name
cex.getBTCWalletMeta(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// return associated details with the wallet name
cex.getETHWalletMeta(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// return associated details with the wallet name
cex.getBSCWalletMeta(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Convert Btc to others equivalent
// other is the name of the asset to convert into
// 
// other should include: 
// - ETH || ether
// - BNB
// - USD
cex.getBTCToOthersRate(other).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// - check if wallet exist on the db
// - if wallet exist it return true otherwise false
cex.checkBTCWalletExists(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// - check if wallet exist on the db
// - if wallet exist it return true otherwise false
cex.checkBSCWalletExists(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// - check if wallet exist on the db
// - if wallet exist it return true otherwise false
cex.checkETHWalletExists(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// - check if Address exist on the pipeline
// - if address exist it return true otherwise return false
cex.checkIfAddressExists(pipeline, address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// - get the total balance of all the addresses associated with the wallet_name
// wallet_name must exist on the server.
cex.getWalletAddressesBalance(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

//Get Transaction Information/Confirmation...
// getBTCTransaction("3KHvxwMriN9bh3Hk1CBZagQjAa3iYVFCp5")
//Transaction data could be any of the following 
// - address
cex.getBTCAddressTransaction(address).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transactions on a btc address deployed to ETH 
//limit is an integer indicating how deep the history should go
//..e,g limit of 1 means 1 result, 2 means 2 results.
cex.getPastBTCTransferEventsonETH(address, limit).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transactions on of USDT address deployed
// pipeline :
// ETH or BSC 
//limit is an integer indicating how deep the history should go
//..e,g limit of 1 means 1 result, 2 means 2 results.
cex.getRecentUSDTAddressTransactions(pipeline, address, limit).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transactions on a btc address deployed to BSC
//limit is an integer indicating how deep the history should go
//..e,g limit of 1 means last block.
cex.getPastBTCTransferEventsonBSC(address, limit).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transfer transactions of ETH address deployed to BSC 
//limit is an integer indicating how deep the history should go
//..e,g limit of 1 means 1 block.
cex.getPastBNBTransferEventsOnETH( address, limit).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transfer transactions of BNB address deployed to ETH
//limit is an integer indicating how deep the history should go
// ..e,g limit of 1 means 1 result, 2 means 2 results, and if it returns an empty array then the address has not perform any transaction within the blocks specify, use 0 to get all time transaction
cex.getPastETHTransferEventsOnBSC( address, limit).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transfer transactions that happened on BSC wallet
cex.getRecentBSCWalletTransactions(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transfer transactions that happened on ETH wallet
cex.getRecentETHWalletTransactions(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)

// Get recent transfer transactions that happened on  BTC wallet
cex.getRecentBTCWalletTransactions(wallet_name).then(
    (result) => {
        console.log(result)
    }
).catch(
    (err) => {
        console.error(err)
    }
)