@ledgerhq/hw-transport-node-speculos
Advanced tools
Comparing version 6.24.1 to 6.24.2-monorepo.0
{ | ||
"name": "@ledgerhq/hw-transport-node-speculos", | ||
"version": "6.24.1", | ||
"version": "6.24.2-monorepo.0", | ||
"description": "Ledger Hardware Wallet communication layer with speculos Nano simulator", | ||
@@ -31,7 +31,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@ledgerhq/errors": "^6.10.0", | ||
"@ledgerhq/hw-transport": "^6.24.1", | ||
"@ledgerhq/logs": "^6.10.0", | ||
"@ledgerhq/errors": "^6.10.1-monorepo.0", | ||
"@ledgerhq/hw-transport": "^6.24.2-monorepo.0", | ||
"@ledgerhq/logs": "^6.10.1-monorepo.0", | ||
"rxjs": "6" | ||
}, | ||
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec", | ||
"scripts": { | ||
@@ -41,5 +42,7 @@ "clean": "bash ../../script/clean.sh", | ||
"watch": "bash ../../script/watch.sh", | ||
"doc": "bash ../../script/doc.sh" | ||
"doc": "bash ../../script/doc.sh", | ||
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx", | ||
"test": "jest" | ||
}, | ||
"gitHead": "159269dafc5f177c7af5b20761ab0ef3550e3faf" | ||
} | ||
"readme": "<img src=\"https://user-images.githubusercontent.com/211411/34776833-6f1ef4da-f618-11e7-8b13-f0697901d6a8.png\" height=\"100\" />\n\n## @ledgerhq/hw-transport-node-speculos\n\nA transport for <https://github.com/LedgerHQ/speculos> Nano simulator.\n\n[Github](https://github.com/LedgerHQ/ledgerjs/),\n[Ledger Devs Slack](https://ledger-dev.slack.com/)\n\n### Getting started\n\n* Install <https://github.com/LedgerHQ/speculos>\n* Make sure to have a speculos running with a APDU port and (optionally) a buttons port available.\n\n```js\nimport SpeculosTransport from \"@ledgerhq/hw-transport-node-speculos\";\n\nconst apduPort = 40000;\n\nasync function exampleSimple() {\n const transport = await SpeculosTransport.open({ apduPort });\n const res = await transport.send(0xE0, 0x01, 0x00, 0x00);\n}\n\nasync function exampleAdvanced() {\n const transport = await SpeculosTransport.open({ apduPort });\n setTimeout(() => {\n // in 1s i'll click on right button and release\n transport.button(\"Rr\");\n }, 1000); // 1s is a tradeoff here. In future, we need to be able to \"await & expect a text\" but that will need a feature from speculos to notify us when text changes.\n // derivate btc address and ask for device verification\n const res = await transport.send(0xE0, 0x40, 0x01, 0x00, Buffer.from(\"058000002c8000000080000000000000000000000f\"));\n}\n```\n\n### With ledger-live CLI\n\nIt's working with SPECULOS_APDU_PORT and SPECULOS_HOST envs.\n\n```sh\nSPECULOS_APDU_PORT=40000 ledger-live sync -c btc\n\n# starts an http proxy with speculos (http proxy that works with LLD and LLM)\nSPECULOS_APDU_PORT=40000 ledger-live proxy\n```\n\nTo make it work with Docker, I had to expose some port and do this:\n\n```sh\ndocker run -it -p 40000:40000 -v \"$(pwd)\"/apps:/speculos/apps speculos /bin/bash\n\n$ pipenv shell\n$ ./speculos.py -m nanos ./apps/btc.elf --sdk 1.6 --seed \"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\" --display headless --apdu-port 40000\n```\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n#### Table of Contents\n\n* [SpeculosTransportOpts](#speculostransportopts)\n * [Properties](#properties)\n* [SpeculosTransport](#speculostransport)\n * [Parameters](#parameters)\n * [Examples](#examples)\n * [button](#button)\n * [Parameters](#parameters-1)\n * [open](#open)\n * [Parameters](#parameters-2)\n\n### SpeculosTransportOpts\n\nType: {apduPort: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), buttonPort: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, automationPort: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, host: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?}\n\n#### Properties\n\n* `apduPort` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** \n* `buttonPort` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** \n* `automationPort` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** \n* `host` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** \n\n### SpeculosTransport\n\n**Extends Transport**\n\nSpeculos TCP transport implementation\n\n#### Parameters\n\n* `apduSocket` **net.Socket** \n* `opts` **[SpeculosTransportOpts](#speculostransportopts)** \n\n#### Examples\n\n```javascript\nimport SpeculosTransport from \"@ledgerhq/hw-transport-node-speculos\";\nconst transport = await SpeculosTransport.open({ apduPort });\nconst res = await transport.send(0xE0, 0x01, 0, 0);\n```\n\n#### button\n\nSend a speculos button command\ntypically \"Ll\" would press and release the left button\ntypically \"Rr\" would press and release the right button\n\n##### Parameters\n\n* `command` **any** \n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<void>** \n\n#### open\n\n##### Parameters\n\n* `opts` **[SpeculosTransportOpts](#speculostransportopts)** \n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[SpeculosTransport](#speculostransport)>** \n" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
1
15718
7
170
1