Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@ledgerhq/hw-app-str
Advanced tools
// when using "@ledgerhq/hw-transport-node-hid" library you need to go to
// Settings -> Browser support in ledger stellar app and set this setting to 'No'
import Transport from "@ledgerhq/hw-transport-node-hid";
// import Transport from "@ledgerhq/hw-transport-u2f"; // for browser
import Str from "@ledgerhq/hw-app-str";
import StellarSdk from "stellar-sdk";
const getStrAppVersion = async () => {
const transport = await Transport.create();
const str = new Str(transport);
const result = await str.getAppConfiguration();
return result.version;
}
getStrAppVersion().then(v => console.log(v));
const getStrPublicKey = async () => {
const transport = await Transport.create();
const str = new Str(transport);
const result = await str.getPublicKey("44'/148'/0'");
return result.publicKey;
};
let publicKey;
getStrPublicKey().then(pk => {
console.log(pk);
publicKey = pk;
});
const signStrTransaction = async (publicKey) => {
const transaction = new StellarSdk.TransactionBuilder({accountId: () => publicKey, sequenceNumber: () => '1234', incrementSequenceNumber: () => null})
.addOperation(StellarSdk.Operation.createAccount({
source: publicKey,
destination: 'GBLYVYCCCRYTZTWTWGOMJYKEGQMTH2U3X4R4NUI7CUGIGEJEKYD5S5OJ', // SATIS5GR33FXKM7HVWZ2UQO33GM66TVORZUEF2HPUQ3J7K634CTOAWQ7
startingBalance: '11.331',
}))
.build();
const transport = await Transport.create();
const str = new Str(transport);
const result = await str.signTransaction("44'/148'/0'", transaction.signatureBase());
// add signature to transaction
const keyPair = StellarSdk.Keypair.fromPublicKey(publicKey);
const hint = keyPair.signatureHint();
const decorated = new StellarSdk.xdr.DecoratedSignature({hint: hint, signature: result.signature});
transaction.signatures.push(decorated);
return transaction;
}
signStrTransaction(publicKey).then(transaction => console.log(transaction.toEnvelope().toXDR().toString('base64')));
You may be using this package to communicate with the Stellar Nano App.
For a smooth and quick integration:
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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
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.