
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@getsafle/bsc-wallet-controller
Advanced tools
This repository contains `BSCHdKeyring` class to create **Binance smart chain wallet** from **Safle Vault**.
This repository contains BSCHdKeyring class to create Binance smart chain wallet from Safle Vault.
We will be using BSCHdKeyring 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 bscWallet = new BSCHdKeyring(`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 BSC wallet and set the 0th address as the default address.
parameters: -
returns: {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 are of 4 types:
TransactionObj: {
data: {
to, // destination address
amount, // amount in wei
},
txnType: NATIVE_TRANSFER // type constant
}
TransactionObj: {
data: {
to, // destination smart contract address
amount, // amount in wei
data, // hex string of the encoded data
},
txnType: CONTRACT_TRANSACTION // type constant
}
parameters:
name: transaction,
type: TransactionObj, // refer to the above 2 trancationObj types.
name: connectionUrl, // BTC network {TESTNET | MAINNET}
type: string,
default: MAINNET (undefined)
optional
returns: {signedTransaction: string} signed raw transaction
This function is used to sign a message.
parameters:
name: message
type: string
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: string
name: connectionUrl, // BTC network {TESTNET | MAINNET}
type: string,
default: MAINNET (undefined)
optional
returns: {transactionDetails : string} // transaction hash
This function is returns the fees in wei which will be used for the passed transaction.
parameters:
name: transaction,
type: TransactionObj, // refer to the 2 trancationObj types provided in signTransaction.
name: connectionUrl, // BTC network {TESTNET | MAINNET}
type: string,
default: MAINNET (undefined)
optional
returns: {transactionFees: integer} // transaction fees
This function is returns the account balance in wei.
parameters:
name: connectionUrl, // BTC network {TESTNET | MAINNET}
type: string,
default: MAINNET (undefined)
optional
returns: {balance: integer} // transaction fees
1.0.0 (2021-12-1)
FAQs
This repository contains `BSCHdKeyring` class to create **Binance smart chain wallet** from **Safle Vault**.
The npm package @getsafle/bsc-wallet-controller receives a total of 0 weekly downloads. As such, @getsafle/bsc-wallet-controller popularity was classified as not popular.
We found that @getsafle/bsc-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 is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.