Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ledgerhq/hw-app-str

Package Overview
Dependencies
Maintainers
7
Versions
339
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/hw-app-str - npm Package Compare versions

Comparing version 4.8.0-rc1.1b178f67 to 4.11.1

flow-typed/npm/@ledgerhq/hw-transport_vx.x.x.js

4

package.json
{
"name": "@ledgerhq/hw-app-str",
"version": "4.8.0-rc1.1b178f67",
"version": "4.11.1",
"description": "Ledger Hardware Wallet Stellar Application API",

@@ -28,3 +28,3 @@ "keywords": [

"dependencies": {
"@ledgerhq/hw-transport": "^4.8.0-rc1.1b178f67",
"@ledgerhq/hw-transport": "^4.7.3",
"base32.js": "^0.1.0",

@@ -31,0 +31,0 @@ "crc": "^3.5.0",

@@ -9,5 +9,8 @@ <img src="https://user-images.githubusercontent.com/211411/34776833-6f1ef4da-f618-11e7-8b13-f0697901d6a8.png" height="100" />

```js
// 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";

@@ -28,6 +31,16 @@ const getStrAppVersion = async () => {

};
getStrPublicKey().then(pk => console.log(pk));
let publicKey;
getStrPublicKey().then(pk => {
console.log(pk);
publicKey = pk;
});
const signStrTransaction = async () => {
const transaction = ...;
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();

@@ -40,3 +53,3 @@ const str = new Str(transport);

const hint = keyPair.signatureHint();
const decorated = new StellarSdk.xdr.DecoratedSignature({hint: hint, signature: signature});
const decorated = new StellarSdk.xdr.DecoratedSignature({hint: hint, signature: result.signature});
transaction.signatures.push(decorated);

@@ -46,3 +59,3 @@

}
signStrTransaction().then(s => console.log(s.toString('hex')));
signStrTransaction(publicKey).then(transaction => console.log(transaction.toEnvelope().toXDR().toString('base64')));
```

@@ -49,0 +62,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc