Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@getsafle/bitcoin-wallet-controller
Advanced tools
This repository contains `BTCHdKeyring` class to create **Bitcoin wallet** from **Safle Vault**. The address type currently created is `p2phk`
This repository contains BTCHdKeyring
class to create Bitcoin wallet from Safle Vault. The address type currently created is p2phk
We will be using BTCHdKeyring
class to initialize the wallet and then utilize the provided functions to perform the required tasks.
The class initialization is done in the following way.
const btcWallet = new BTCHdKeyring(`mnemonic`)
mnemonic
is the BIP-39 key phrase to generate the wallet.
Once we initialize the class, we can utilize the provided functions.
The wallet have the following functions:
This function is used to generate the Bitcoin wallet and set the 0th address as the default address.
parameters: -
wallet_object: BIP32 object
returns: {wallet: wallet_object, address: string} // wallet address
This function is used to export the private key for the generated address.
parameters: -
returns: {privateKey: string} // address private key
This function is used to sign a transaction off-chain and then send it to the network.
Transactions type is as below:
TransactionObj: {
data: {
to, // destination address
amount, // amount
}
}
parameters:
name: transaction,
type: TransactionObj, // refer to the above trancationObj types.
name: connectionUrl, // BTC network URL
type: string,
default: MAINNET (undefined)
optional
returns: {signedTransaction: string} hex_string of signed raw transaction
This function is used to sign a message.
parameters:
name: message
type: string
name: connectionUrl, // BTC network {TESTNET | MAINNET}
type: string,
default: MAINNET (undefined)
optional
returns: {signedMessage: string} // signed message hex string
This function is used to get the wallet address.
parameters: -
returns: {address: string} // wallet address
This function is used send the signed transaction onto the chain.
parameters:
name: rawTransaction, // signed raw transaction (got from signedTransaction())
type: Buffer | UInt8Array
name: connectionUrl, // BTC network {TESTNET | MAINNET}
type: string,
default: MAINNET (undefined)
optional
returns: {transactionDetails : Object} // transaction details with transaction hash
This function is used to get the transaction fees.
parameters: -
returns: {transactionFees: integer} // transaction fees
We are using https://sochain.com
API to fetch and publish data on bitcoin network.
1.0.0 (2021-12-27)
FAQs
This repository contains `BTCHdKeyring` class to create **Bitcoin wallet** from **Safle Vault**. The address type currently created is `p2phk`
The npm package @getsafle/bitcoin-wallet-controller receives a total of 1 weekly downloads. As such, @getsafle/bitcoin-wallet-controller popularity was classified as not popular.
We found that @getsafle/bitcoin-wallet-controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.