Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@ledgerhq/hw-app-str
Advanced tools
GitHub, Ledger Devs Discord, Developer Portal
Ledger Hardware Wallet Stellar JavaScript bindings.
You may be using this package to communicate with the Stellar Nano App.
For a smooth and quick integration:
All functions may throw an error, it's important to handle the errors properly.
We have written corresponding classes for exceptions that developers should actively handle, you can find them in the API section.
Error thrown when hash signing is not enabled on the device.
Error thrown when data parsing fails.
For example, when parsing the transaction fails, this error is thrown.
Error thrown when the user refuses the request on the device.
Error thrown when the data is too large to be processed by the device.
Stellar API
transport
Transport a transport for sending commands to a devicescrambleKey
a scramble key (optional, default "l0v"
)import Str from "@ledgerhq/hw-app-str";
const str = new Str(transport)
Get Stellar application configuration.
str.getAppConfiguration().then(o => o.version)
Returns Promise<{version: string, hashSigningEnabled: boolean, maxDataSize: number?}> an object with the application configuration, including the version, whether hash signing is enabled, and the maximum data size in bytes that the device can sign.
Get Stellar raw public key for a given BIP 32 path.
path
string a path in BIP 32 formatdisplay
if true, the device will ask the user to confirm the address on the device, if false, it will return the raw public key directly (optional, default false
)str.getPublicKey("44'/148'/0'").then(o => o.rawPublicKey)
Returns Promise<{rawPublicKey: Buffer}> an object with the raw ed25519 public key. If you want to convert it to string, you can use StrKey.encodeEd25519PublicKey
Sign a Stellar transaction.
path
string a path in BIP 32 formattransaction
Buffer signature base of the transaction to signstr.signTransaction("44'/148'/0'", signatureBase).then(o => o.signature)
Returns Promise<{signature: Buffer}> an object with the signature
Sign a Stellar Soroban authorization.
path
string a path in BIP 32 formathashIdPreimage
Buffer the Soroban authorization hashIdPreimage to signstr.signSorobanAuthorization("44'/148'/0'", hashIdPreimage).then(o => o.signature)
Returns Promise<{signature: Buffer}> an object with the signature
Sign a hash.
str.signHash("44'/148'/0'", hash).then(o => o.signature)
Returns Promise<{signature: Buffer}> an object with the signature
FAQs
Ledger Hardware Wallet Stellar Application API
The npm package @ledgerhq/hw-app-str receives a total of 0 weekly downloads. As such, @ledgerhq/hw-app-str popularity was classified as not popular.
We found that @ledgerhq/hw-app-str 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.