diff --git a/apps/docs/package.json b/apps/docs/package.json
index 8fd00ce78..1e486432c 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -24,6 +24,7 @@
"nextra-theme-docs": "^3.0.15",
"react": "^18.3.1",
"react-dom": "^18.3.1",
+ "react-medium-image-zoom": "5.1.8",
"tailwindcss": "^3.4.16",
"tailwind-merge": "^1.14.0"
},
diff --git a/apps/docs/pages/docs/ledgerjs/_meta.js b/apps/docs/pages/docs/ledgerjs/_meta.js
index 314b3c27f..443c74bb2 100644
--- a/apps/docs/pages/docs/ledgerjs/_meta.js
+++ b/apps/docs/pages/docs/ledgerjs/_meta.js
@@ -1,7 +1,7 @@
export default {
- info: "Info note",
- beginner: "Beginner's guides",
- integration: "Integration walkthroughs",
- references: "References",
- explanation: "Explanation"
-}
+ info: "Info note",
+ beginner: "Beginner's guides",
+ integration: "Integration walkthroughs",
+ references: "References",
+ explanation: "Explanation",
+};
diff --git a/apps/docs/pages/docs/ledgerjs/beginner/_meta.js b/apps/docs/pages/docs/ledgerjs/beginner/_meta.js
index 127bbb732..f1d1836b0 100644
--- a/apps/docs/pages/docs/ledgerjs/beginner/_meta.js
+++ b/apps/docs/pages/docs/ledgerjs/beginner/_meta.js
@@ -1,7 +1,7 @@
-export default {
- 'transfer-eth': "Transfer of Ethers between accounts",
- 'transfer-sol': "Transfer of Sol between accounts",
- 'smart-contract': "Call a Smart Contract",
- 'personal-message': "Sign a personnal message",
- 'cosmos-app': "Interact with the Cosmos app"
-}
\ No newline at end of file
+export default {
+ "transfer-eth": "Transfer of Ethers between accounts",
+ "transfer-sol": "Transfer of Sol between accounts",
+ "smart-contract": "Call a Smart Contract",
+ "personal-message": "Sign a personnal message",
+ "cosmos-app": "Interact with the Cosmos app",
+};
diff --git a/apps/docs/pages/docs/ledgerjs/beginner/cosmos-app.mdx b/apps/docs/pages/docs/ledgerjs/beginner/cosmos-app.mdx
index a1c0bc744..1f786de3c 100644
--- a/apps/docs/pages/docs/ledgerjs/beginner/cosmos-app.mdx
+++ b/apps/docs/pages/docs/ledgerjs/beginner/cosmos-app.mdx
@@ -1,20 +1,19 @@
---
title: Interact with the Cosmos App
-description: In this section, we will guide you through the creation of a web application. This application will connect to your Nano and will allow you to use the Cosmos Embedded App.
+description: In this section, we will guide you through the creation of a web application. This application will connect to your Nano and will allow you to use the Cosmos Embedded App.
---
-import Zoom from 'react-medium-image-zoom'
-import 'react-medium-image-zoom/dist/styles.css'
-import Image from 'next/image'
-
+import Zoom from "react-medium-image-zoom";
+import "react-medium-image-zoom/dist/styles.css";
+import Image from "next/image";
# Interact with the Cosmos App
-## Introduction
+## Introduction
+
+In this section, we will guide you through the creation of a web application. This application will connect to your Nano and will allow you to use the Cosmos Embedded App.
-In this section, we will guide you through the creation of a web application. This application will connect to your Nano and will allow you to use the Cosmos Embedded App.
-
-Web USB and Web HID applications are implemented with `@ledgerhq/hw-transport-webusb` and `@ledgerhq/hw-transport-webhid` respectively.
+Web USB and Web HID applications are implemented with `@ledgerhq/hw-transport-webusb` and `@ledgerhq/hw-transport-webhid` respectively.
This web application was originally developed by the Zondax team (here is a link to [their website](https://zondax.ch/) and to their [Twitter feed](https://twitter.com/_zondax_)) through [this source repo](https://github.com/cosmos/ledger-cosmos-js.git)). Zondax has been developing innovative end-to-end software solutions that are used by a large number of exchanges, hardware wallets, privacy coins, and decentralized finance (DeFi) protocols. Zondax has proven to be a reliable partner for Ledger apps development with more than 35 applications built to date.
@@ -36,30 +35,33 @@ You will be able to do the following actions:
First, open a terminal and create a new folder in your usual working directory. For this tutorial, the folder will be named “use-cosmos-webapp”.
Run:
+
```bash copy
mkdir use-cosmos-webapp
cd use-cosmos-webapp
```
Clone the repo (master branch) and go to the repo folder:
+
```bash copy
git clone https://github.com/LedgerHQ/ledger-cosmos-js.git
cd ledger-cosmos-js
```
Run:
+
```bash copy
-yarn install
-npm install -g @vue/cli
+yarn install
+npm install -g @vue/cli
npm install -g @vue/cli-plugin-typescript
npm install vue-template-compiler
npm install --save-dev webpack
```
-
## Usage
Now, that all the needed packages are installed, you can launch the webapp by runnig:
+
```bash copy
npm run serve
```
@@ -68,29 +70,28 @@ The application is up and running. Open the browser and go to `http://localhost:

-- Make sure to select the **WebUSB** option (as the U2F option is deprecated).
+- Make sure to select the **WebUSB** option (as the U2F option is deprecated).
- Connect your Nano to the USB port, unlock it and run the cosmos application. You’re now able to interact with the cosmos application.
- Click on **Get Version**:
-
+
-
You’re able to retrieve the app version installed on your Ledger Nano device and some other information using the `getVersion()` function.
- Click on **AppInfo**:
-
+
You’re able to retrieve the app version but also the app name and some other information using the `appInfo()` function.
@@ -98,10 +99,10 @@ You’re able to retrieve the app version but also the app name and some other i
- Click on **Get pubkey only**:
-
+
You can retrieve the data contained in the public key and some other information using the `getPublicKey()` function.
@@ -109,122 +110,168 @@ You can retrieve the data contained in the public key and some other information
- Click on **Get Address and Pubkey**:
-
+
-
You can retrieve the public address, the data contained in the public key and some other information using the `getAddress()` and `getPublicKey()` functions.
- Click on **Show Address and Pubkey**:
-
-
-
-
- As in the previous step, you can retrieve the public address, the data contained in the public key and some other information, but here you can preview the public address on your Nano. The address you see on the Nano is the same as what you can have on your web app. In this case, the `showAddressAndPubKey()` function is used.
-
- - Press the right button to do the review:
-
-
-
-
-
-
- - Verify that the correct address is showing on your Nano. Then, you can press the right button to approve or reject.
-
-
-
-
-
- - You can confirm by pressing both buttons.
-
-
-
-
-
- - You can also reject.
-
-
-
-
-
- After approving the review, the webapp will display to you the public address, the data of the public key and some other information.
-
-- Click on **Sign Example TX**:
+
+
+
+
+ As in the previous step, you can retrieve the public address, the data contained in the public key and some other information, but here you can preview the public address on your Nano. The address you see on the Nano is the same as what you can have on your web app. In this case, the `showAddressAndPubKey()` function is used.
+
+ - Press the right button to do the review:
+
+
+
+
+
+
+ - Verify that the correct address is showing on your Nano. Then, you can press the right button to approve or reject.
+
+
+
+
+
+
+ - You can confirm by pressing both buttons.
+
+
+
+
+
+
+ - You can also reject.
+
+
+
+
+
+ After approving the review, the webapp will display to you the public address, the data of the public key and some other information.
+
+- Click on **Sign Example TX**:

-Here, it provides you with an example of a transaction to sign on your Ledger Nano device using the `signExampleTx()` function. You’ll have to review the Chain ID, the Account, the Sequence, the Type, the Amount, the Delegator, the Validator, the Memo, the Fees and the Gas. Then you can approve or decline the transaction.
+Here, it provides you with an example of a transaction to sign on your Ledger Nano device using the `signExampleTx()` function. You’ll have to review the Chain ID, the Account, the Sequence, the Type, the Amount, the Delegator, the Validator, the Memo, the Fees and the Gas. Then you can approve or decline the transaction.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
If approved, your transaction is signed and the webapp will display it along with the type of transaction (here, a signature) and some other information.

-
-
diff --git a/apps/docs/pages/docs/ledgerjs/beginner/personal-message.mdx b/apps/docs/pages/docs/ledgerjs/beginner/personal-message.mdx
index 49674a427..75b533bd1 100644
--- a/apps/docs/pages/docs/ledgerjs/beginner/personal-message.mdx
+++ b/apps/docs/pages/docs/ledgerjs/beginner/personal-message.mdx
@@ -3,11 +3,10 @@ title: Sign a personal message
description: In this section, we will guide you through the creation of a web application. This application will connect to your Nano and will display the “test“ message to be signed with an Ethereum account using the personal sign message functionality introduced by EIP-191.
---
-import { Callout } from 'nextra/components'
-import Zoom from 'react-medium-image-zoom'
-import 'react-medium-image-zoom/dist/styles.css'
-import Image from 'next/image'
-
+import { Callout } from "nextra/components";
+import Zoom from "react-medium-image-zoom";
+import "react-medium-image-zoom/dist/styles.css";
+import Image from "next/image";
# Sign a personal message
@@ -19,11 +18,11 @@ Web USB and Web HID applications are implemented with `@ledgerhq/hw-transport-we
## Use case
-This tutorial will let you sign a message with your private key in order to verify and prove that you’re the owner of the address.
+This tutorial will let you sign a message with your private key in order to verify and prove that you’re the owner of the address.
## Tutorial Prerequisites
-- Ensure you have gone through the [prerequisites](../getting-started#prerequisites).
+- Ensure you have gone through the [prerequisites](../getting-started#prerequisites).
- Install or update your Ethereum Embedded App to the version 1.9.19 or later.
## Coding
@@ -39,14 +38,12 @@ mkdir example-sign-personal-message
cd example-sign-personal-message
```
-
Initialize the project by running:
```bash copy
npm init
```
-
Answer the questions displayed or by default press enter. There is no incidence on the execution.
Run:
@@ -61,7 +58,6 @@ The folder will contain these files:

-
### Coding
Open the folder example-sign-personal-message in a code editor.
@@ -73,31 +69,32 @@ In index.html copy and paste the following code:
```html copy
-
-
- My First Embedded App
-
-
-
-
-
-
-
-
+
+
+ My First Embedded App
+
+
+
+
+
+
```
-
-#### main.js
+#### main.js
In main.js copy and paste the following code:
- Comment out or remove the Transport package you are not using (@ledgerhq/hw-transport-webusb or @ledgerhq/hw-transport-webhid) and the corresponding const. In the example, we use webusb. Webhid is already commented in line 8 and line 23.
+ Comment out or remove the Transport package you are not using (
+ @ledgerhq/hw-transport-webusb or{" "}
+ @ledgerhq/hw-transport-webhid) and the corresponding{" "}
+ const. In the example, we use webusb. Webhid is already commented
+ in line 8 and line 23.
```js copy
-import 'core-js/actual';
+import "core-js/actual";
import { listen } from "@ledgerhq/logs";
import Eth from "@ledgerhq/hw-app-eth";
@@ -107,57 +104,58 @@ import Eth from "@ledgerhq/hw-app-eth";
import TransportWebHID from "@ledgerhq/hw-transport-webhid";
//Display the header in the div which has the ID "main"
-const initial = "
Connect your Nano and open the Ethereum app. Click on “Hash my message”
";
+const initial =
+ "
Connect your Nano and open the Ethereum app. Click on “Hash my message”
";
const $main = document.getElementById("main");
$main.innerHTML = initial;
document.querySelector("#hashMessage").addEventListener("click", async () => {
- $main.innerHTML = initial;
- try {
-
- //trying to connect to your Ledger device with USB protocol
- // const transport = await TransportWebUSB.create();
-
- //trying to connect to your Ledger device with HID protocol
- const transport = await TransportWebHID.create();
-
- //listen to the events which are sent by the Ledger packages in order to debug the app
- listen(log => console.log(log))
-
- //When the Ledger device connected it is trying to display the bitcoin address
- const eth = new Eth(transport);
- const signature = await eth.signPersonalMessage("44'/60'/0'/0/0", Buffer.from("test").toString("hex"));
- const signedHash = "0x" + signature.r + signature.s + signature.v.toString(16);
-
- //Display your bitcoin address on the screen
- const h2 = document.createElement("h2");
- h2.textContent = signedHash;
- $main.innerHTML = "
Your signed message:
";
- $main.appendChild(h2);
-
- //Display the address on the Ledger device and ask to verify the address
- const { address } = await eth.getAddress("44'/60'/0'/0/0");
- const add = document.createElement("div");
- add.textContent = address
- $main.appendChild(add);
- } catch (e) {
-
- //Catch any error thrown and displays it on the screen
- const $err = document.createElement("code");
- $err.style.color = "#f66";
- $err.textContent = String(e.message || e);
- $main.appendChild($err);
- }
+ $main.innerHTML = initial;
+ try {
+ //trying to connect to your Ledger device with USB protocol
+ // const transport = await TransportWebUSB.create();
+
+ //trying to connect to your Ledger device with HID protocol
+ const transport = await TransportWebHID.create();
+
+ //listen to the events which are sent by the Ledger packages in order to debug the app
+ listen((log) => console.log(log));
+
+ //When the Ledger device connected it is trying to display the bitcoin address
+ const eth = new Eth(transport);
+ const signature = await eth.signPersonalMessage(
+ "44'/60'/0'/0/0",
+ Buffer.from("test").toString("hex"),
+ );
+ const signedHash =
+ "0x" + signature.r + signature.s + signature.v.toString(16);
+
+ //Display your bitcoin address on the screen
+ const h2 = document.createElement("h2");
+ h2.textContent = signedHash;
+ $main.innerHTML = "
Your signed message:
";
+ $main.appendChild(h2);
+
+ //Display the address on the Ledger device and ask to verify the address
+ const { address } = await eth.getAddress("44'/60'/0'/0/0");
+ const add = document.createElement("div");
+ add.textContent = address;
+ $main.appendChild(add);
+ } catch (e) {
+ //Catch any error thrown and displays it on the screen
+ const $err = document.createElement("code");
+ $err.style.color = "#f66";
+ $err.textContent = String(e.message || e);
+ $main.appendChild($err);
+ }
});
```
-
-
## Dependencies Installation
### Install the packages
-Run:
+Run:
```bash copy
npm install --save core-js
@@ -172,13 +170,13 @@ npm install --save-dev stream-browserify
### Install the Transport HID or USB package
-Then depending on your choice install one of the corresponding packages:
+Then depending on your choice install one of the corresponding packages:
+
- Install the Ledger package `@ledgerhq/hw-transport-webhid` which provide you with all the methods to interact with your Nano with an HID connection (make sure that you use the 6.27.1 version):
-`npm install --save @ledgerhq/hw-transport-webhid@6.27.1`
+ `npm install --save @ledgerhq/hw-transport-webhid@6.27.1`
- Install the Ledger package `@ledgerhq/hw-transport-webusb` which provide you with all the methods to interact with your Nano with a USB connection (make sure that you use the 6.27.1 version):
-`npm install --save @ledgerhq/hw-transport-webusb@6.27.1`
-
+ `npm install --save @ledgerhq/hw-transport-webusb@6.27.1`
### Package.json
@@ -194,6 +192,7 @@ Ensure you have this line in your `package.json`:
```
And:
+
```json copy
"alias": {
@@ -242,8 +241,6 @@ Your `package.json` should look like this:
}
```
-
-
## Usage
### Start the development server
@@ -254,11 +251,10 @@ Now that the Setup is finished, the app has to be built to be displayed. Start t
npm run start
```
-Now the application is up and running. Open the browser and go to `localhost:1234`, it will display:
+Now the application is up and running. Open the browser and go to `localhost:1234`, it will display:

-
### Plug your Nano
Before clicking on the “Hash my message”, connect your Nano to the USB port, unlock it and run the ethereum application. Then, click on “Hash my message”.
@@ -267,38 +263,36 @@ Before clicking on the “Hash my message”, connect your Nano to the USB port,
When you click on the “Hash my message”, a popup message will be prompt inviting you to sign a message.
-
+
-
+
Click the right button to see the content of the message that you are going to sign with your Ethereum address:
-
+
-
+
-
### Sign the message
Click the right button to the next screens to sign the “test” message or decline it:
-
+
-
+
-
+
-
+
Once signed, the webapp will display:
+
- The signed message (“hash”)
- The Ethereum address used to sign the message
-
-
### Verify on runkit.com
You can verify that you are the one who signed the message by signing in on [runkit.com](https://runkit.com/home) and running the following piece of code.
@@ -307,14 +301,14 @@ You can verify that you are the one who signed the message by signing in on [run
```js copy
const { ethers } = require("ethers");
-ethers.verifyMessage("test", "0xefb42c22baa0143b322e93b24b0903a0ef47a64b716fbb77debbea55a93dec3e4417aff7dce845723240916c6e34cf17c674828b3addfb0afad966334df5b6311b");
+ethers.verifyMessage(
+ "test",
+ "0xefb42c22baa0143b322e93b24b0903a0ef47a64b716fbb77debbea55a93dec3e4417aff7dce845723240916c6e34cf17c674828b3addfb0afad966334df5b6311b",
+);
```
2. Run your code, it should now display the Ethereum address linked to the signed message (the run can take a bit of time):
-
+
diff --git a/apps/docs/pages/docs/ledgerjs/beginner/smart-contract.mdx b/apps/docs/pages/docs/ledgerjs/beginner/smart-contract.mdx
index 1b61548d5..ff087ffc7 100644
--- a/apps/docs/pages/docs/ledgerjs/beginner/smart-contract.mdx
+++ b/apps/docs/pages/docs/ledgerjs/beginner/smart-contract.mdx
@@ -3,25 +3,26 @@ title: Call a Smart Contract
description: In this section, we will guide you through the creation of an application that will call a smart contract to read and write.
---
-import { Callout } from 'nextra/components'
-import Image from 'next/image'
-
+import { Callout } from "nextra/components";
+import Image from "next/image";
# Call a Smart Contract
## Introduction
+
In this section, we will guide you through the creation of an application that will call a smart contract to read and write.
## Tutorial Prerequisites
+
Before starting, make sure you have gone through the [prerequisites](../getting-started#prerequisites).
### Receive Ether token in your Ledger Nano Ethereum Sepolia account
- Create an Ethereum Sepolia account in Ledger Live
-- Send Sepolia Eth to your account with [Infura faucet](https://www.infura.io/faucet/sepolia). You will need to create an account that will be useful later for the API key.
+- Send Sepolia Eth to your account with [Infura faucet](https://www.infura.io/faucet/sepolia). You will need to create an account that will be useful later for the API key.

-*Fig. 1: Sepolia Ethereum Faucet*
+_Fig. 1: Sepolia Ethereum Faucet_
## Web App Bluetooth (only Nano X)
@@ -55,18 +56,17 @@ touch ./ethereum.js
touch ./styles/global.css
touch ./styles/Home.module.css
mv src/index.js pages
-mv src/App.js ./
-rm -r src
+mv src/App.js ./
+rm -r src
```
-The folder will contain these files:
+The folder will contain these files:

-*Fig. 1: Folder of the Application*
+_Fig. 1: Folder of the Application_
To implement the Ledger connexion you will only modify "App.js", "index.js", "ConnectLedger.js”,"SmartContract.js", and ethereum.js”
-
### Code Implementation
#### App.js
@@ -74,88 +74,87 @@ To implement the Ledger connexion you will only modify "App.js", "index.js", "Co
In App.js copy-paste the following code:
```javascript copy
-import React, { useState } from 'react';
-import ConnectLedger from './ConnectLedger.js';
-import SmartContract from './SmartContract.js';
-
+import React, { useState } from "react";
+import ConnectLedger from "./ConnectLedger.js";
+import SmartContract from "./SmartContract.js";
+
function App() {
const [transport, setTransport] = useState(undefined);
const [eth, setEth] = useState(undefined);
const [address, setAddress] = useState(undefined);
-
+
const saveInfo = (info) => {
setAddress(info.address);
setEth(info.eth);
setTransport(info.transport);
- }
-
+ };
+
return (
-
);
}
-
+
export default SmartContract;
```
@@ -259,66 +257,65 @@ export default SmartContract;
In "ethereum.js", copy-paste the following code:
```javascript copy
-import { Contract } from 'ethers';
-
+import { Contract } from "ethers";
+
const getBlockchain = (provider) =>
- new Promise( async (resolve, reject) => {
- if(provider) {
+ new Promise(async (resolve, reject) => {
+ if (provider) {
const simpleStorage = new Contract(
"0xA0aB0fae9C6b4882dC3690cb1705D5Aeb8c436d7",
[
{
- "inputs": [],
- "name": "data",
- "outputs": [
+ inputs: [],
+ name: "data",
+ outputs: [
{
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
+ internalType: "uint256",
+ name: "",
+ type: "uint256",
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: "view",
+ type: "function",
},
{
- "inputs": [],
- "name": "readData",
- "outputs": [
+ inputs: [],
+ name: "readData",
+ outputs: [
{
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
+ internalType: "uint256",
+ name: "",
+ type: "uint256",
+ },
],
- "stateMutability": "view",
- "type": "function"
+ stateMutability: "view",
+ type: "function",
},
{
- "inputs": [
+ inputs: [
{
- "internalType": "uint256",
- "name": "_data",
- "type": "uint256"
- }
+ internalType: "uint256",
+ name: "_data",
+ type: "uint256",
+ },
],
- "name": "updateData",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- }
+ name: "updateData",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
],
- provider
+ provider,
);
- resolve({simpleStorage});
+ resolve({ simpleStorage });
return;
}
- reject('Provider not recognized');
+ reject("Provider not recognized");
});
-
+
export default getBlockchain;
```
-
### Dependencies Installation
Run:
@@ -332,15 +329,16 @@ npm install --save buffer
npm install --save next
```
-| Package | What does it do? |
-| ------- | ---------------- |
-| [bootstrap](https://getbootstrap.com/) | It allows you to use the Bootstrap CSS framework. |
-| [ethers](https://docs.ethers.io/v5/) | It provides you with all the methods to interact with the Ethereum blockchain. For this tutorial, we use the 5.4.7 version. |
-| [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It will help you ask your Nano to access the ethereum address. |
-| [@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
-| [buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
+| Package | What does it do? |
+| ---------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
+| [bootstrap](https://getbootstrap.com/) | It allows you to use the Bootstrap CSS framework. |
+| [ethers](https://docs.ethers.io/v5/) | It provides you with all the methods to interact with the Ethereum blockchain. For this tutorial, we use the 5.4.7 version. |
+| [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It will help you ask your Nano to access the ethereum address. |
+| [@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
+| [buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
#### Package.json Dependencies
+
Now that the dependencies are installed you can find them in the "package.js".
This is how your "package.json" shoud look like:
@@ -390,8 +388,11 @@ This is how your "package.json" shoud look like:
}
}
```
+
## Web App Test
+
### Start the Development Server
+
Run:
```console copy
@@ -399,129 +400,188 @@ npm run dev
```
- All the browser do not support the Bluetooth please look at the browser support .
+ All the browser do not support the Bluetooth please look at the{" "}
+
+ {" "}
+ browser support{" "}
+
+ .
Now the application is up and running. Open the browser and go to `localhost:3000`, it will display :

-*Fig. 2: Application Running on Browser*
+_Fig. 2: Application Running on Browser_
Don't click on the button yet.
### Launch the Ethereum App
+
Before clicking on the button, unlock your Nano X and run the Ethereum application.
The steps are described below.
-
+
-
- Fig. 3: Ledger Enter Code Pin
+
+
+ Fig. 3: Ledger Enter Code Pin
+
-
- Fig. 5: Application is running
+
+
+ Fig. 5: Application is running
+
- For the tutorial to work, go to the Ethereum app settings and enable Blind Signing.
+ For the tutorial to work, go to the Ethereum app settings and enable Blind
+ Signing.
-
### Connect Your Nano to the Application
+
Now you can click on the button and a popup opens. Choose your Ledger Nano X and click connexion.

-*Fig. 6: Connect the Ledger with Bluetooth*
+_Fig. 6: Connect the Ledger with Bluetooth_
### Read the data of a Smart Contract
+
Now you can click on the button "Get Data" to read the data of the smart contract. Then the data will be displayed on the screen.

-*Fig. 7: Get data from a smart contract*
-
+_Fig. 7: Get data from a smart contract_
### Update the data of a Smart Contract
+
Now instead of reading data, we will overwrite the data by calling a function of the smart contract which is "UpdateData".

-*Fig. 8: Change data from a smart contract*
+_Fig. 8: Change data from a smart contract_
### Verify the Address on your Nano
+
For security reasons, the address will also be displayed on your Ledger Nano X to verify and confirm the address.
-
+
-
-
-
- Fig. 14: Nano Max Fees Screen
- Fig. 15: Nano Accept and Send Screen
+
+
+
+
+ Fig. 14: Nano Max Fees Screen
+
+
+ Fig. 15: Nano Accept and Send Screen
+
- For the Smart Contract call you need to allow blind signing because the smart contract that is called in the tutorial is not yet verified and reviewed by Ledger. But if the smart contract you are calling is accepted by Ledger do not enable blind signing. Moreover, we do not recommend enabling blind signing in other situations as the main purpose to sign with Ledger is the 'Sign what you see' system. And by enabling blind signing it can not ensure that what you see is what you get.
+ For the Smart Contract call you need to allow blind signing because the smart
+ contract that is called in the tutorial is not yet verified and reviewed by
+ Ledger. But if the smart contract you are calling is accepted by Ledger do not
+ enable blind signing. Moreover, we do not recommend enabling blind signing in
+ other situations as the main purpose to sign with Ledger is the 'Sign what you
+ see' system. And by enabling blind signing it can not ensure that what you see
+ is what you get.
-
### Review the Transaction on Sepolia Etherscan
+
By updating the data a transaction is created to change this data, it can be verified on Sepolia Etherscan.
-
-*Fig. 15: Sepolia Etherscan*
+
+_Fig. 15: Sepolia Etherscan_
Wait till the status passes to Success.
-
-*Fig. 16: Sepolia Etherscan*
+
+_Fig. 16: Sepolia Etherscan_
### Verify the update of data
Finally, to verify if data was updated, open the web application and click on "Get data".

-*Fig. 17: Verify the data*
+_Fig. 17: Verify the data_
-
-*Fig. 18: Verify the data*
+
+_Fig. 18: Verify the data_
-Congratulations, you have successfully built your first application connected with Ledger!
\ No newline at end of file
+Congratulations, you have successfully built your first application connected with Ledger!
diff --git a/apps/docs/pages/docs/ledgerjs/beginner/transfer-eth.mdx b/apps/docs/pages/docs/ledgerjs/beginner/transfer-eth.mdx
index f70c43dec..019a60579 100644
--- a/apps/docs/pages/docs/ledgerjs/beginner/transfer-eth.mdx
+++ b/apps/docs/pages/docs/ledgerjs/beginner/transfer-eth.mdx
@@ -3,36 +3,38 @@ title: Transfer of Ethers between accounts
description: In this section, we will guide you through the creation of an application. This application will create a transaction that will be signed with the Ledger Nano before sending it to the blockchain.
---
-import Image from 'next/image'
-
+import Image from "next/image";
# Transfer of Ethers between accounts
## Introduction
-In this section, we will guide you through the creation of an application that:
-- creates a transaction
-- signs it using the Ledger Nano then
-- sends it to the blockchain.
+
+In this section, we will guide you through the creation of an application that:
+
+- creates a transaction
+- signs it using the Ledger Nano then
+- sends it to the blockchain.
The purpose of the application is to transfer ethers from your ethereum account on your Ledger to another account.
## Tutorial Prerequisites
+
Before starting, make sure you have gone through the [prerequisites](../getting-started#prerequisites).
### Receive Ether token in your Ledger Nano Ethereum Sepolia account
- Create an Ethereum Sepolia account in Ledger Live
-- Send Sepolia Eth to your account with [Infura faucet](https://www.infura.io/faucet/sepolia). You will need to create an account that will be useful later for the API key.
+- Send Sepolia Eth to your account with [Infura faucet](https://www.infura.io/faucet/sepolia). You will need to create an account that will be useful later for the API key.

-*Fig. 1: Sepolia Ethereum Faucet*
-
+_Fig. 1: Sepolia Ethereum Faucet_
## Tutorial implementation
In this implementation, we will be building a web application with vanilla javascript that uses the HID protocol from a [Ledger package](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webhid) to communicate with the ledger.
### Project Initialization
+
It is time to implement the application and test it. First, open a terminal and create a new folder. For this tutorial, the folder will be named "e2e-eth-tutorial”.
Run:
@@ -60,10 +62,10 @@ mkdir assets
Copy [the logo](../faq/ledger-logos) in the assets folder.
-The folder will contain these files:
+The folder will contain these files:

-*Fig. 3: Folder of the Application*
+_Fig. 3: Folder of the Application_
### Code Implementation
@@ -77,67 +79,116 @@ In index.html copy-paste the following code :
Parcel Sandbox
-
-
-
+
+
+
-
+
Click on the bellow button to connect your Ledger Wallet
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
Ropsten etherscan:
-
+
Ropsten etherscan:
+
-
+
-
Choose your Wallet
-
+
+ Choose your Wallet
+
+
-
@@ -147,7 +198,6 @@ In index.html copy-paste the following code :
```
-
#### index.js
In index.js copy-paste the following code and replace `{YOUR_INFURA_APIKEY}` by the API key you will find on your Infura account:
@@ -157,13 +207,13 @@ import { ethers } from "ethers";
import { InfuraProvider } from "ethers";
import TransportWebHID from "@ledgerhq/hw-transport-webhid";
import Eth from "@ledgerhq/hw-app-eth";
-import ledgerService from "@ledgerhq/hw-app-eth/lib/services/ledger"
-
+import ledgerService from "@ledgerhq/hw-app-eth/lib/services/ledger";
-var ethers = require('ethers');
+var ethers = require("ethers");
//Infuria provider for Sepolia network
-const provider = new ethers.JsonRpcProvider("https://sepolia.infura.io/v3/{YOUR_INFURA_APIKEY}");
-
+const provider = new ethers.JsonRpcProvider(
+ "https://sepolia.infura.io/v3/{YOUR_INFURA_APIKEY}",
+);
const chainId = 11155111; // Sepolia chainId
let gasPrice;
@@ -175,70 +225,77 @@ let nonce;
let _eth;
document.getElementById("connect-ledger").onclick = async function () {
-
- //Connecting to the Ledger Nano with HID protocol
- const transport = await TransportWebHID.create();
-
- //Getting an Ethereum instance and get the Ledger Nano ethereum account public key
- _eth = new Eth(transport);
- const { address } = await _eth.getAddress("44'/60'/0'/0/0", false);
-
- //Get some properties from provider
- addressWallet = address;
- gasPrice = (await provider.getFeeData()).gasPrice;
-
- //Fill the inputs with the default value
- document.getElementById("wallet").value = address;
- document.getElementById("gasPrice").value = ethers.formatUnits(gasPrice, 'wei');
- document.getElementById("chainId").value = chainId;
- document.getElementById("value").value = value;
- document.getElementById("recipient").value = recipient;
- document.getElementById("gasLimit").value = gasLimit;
-}
-
+ //Connecting to the Ledger Nano with HID protocol
+ const transport = await TransportWebHID.create();
+
+ //Getting an Ethereum instance and get the Ledger Nano ethereum account public key
+ _eth = new Eth(transport);
+ const { address } = await _eth.getAddress("44'/60'/0'/0/0", false);
+
+ //Get some properties from provider
+ addressWallet = address;
+ gasPrice = (await provider.getFeeData()).gasPrice;
+
+ //Fill the inputs with the default value
+ document.getElementById("wallet").value = address;
+ document.getElementById("gasPrice").value = ethers.formatUnits(
+ gasPrice,
+ "wei",
+ );
+ document.getElementById("chainId").value = chainId;
+ document.getElementById("value").value = value;
+ document.getElementById("recipient").value = recipient;
+ document.getElementById("gasLimit").value = gasLimit;
+};
document.getElementById("tx-transfer").onclick = async function () {
- //Getting information from the inputs
- addressWallet = document.getElementById("wallet").value;
- recipient = document.getElementById("recipient").value;
- value = document.getElementById("value").value;
- gasLimit = parseInt(document.getElementById("gasLimit").value);
- nonce = await provider.getTransactionCount(addressWallet, "latest");
-
- //Building transaction with the information gathered
- const transaction = {
- to: recipient,
- gasPrice: "0x" + parseInt(gasPrice).toString(16),
- gasLimit: ethers.toBeHex(gasLimit),
- nonce: nonce,
- chainId: chainId,
- data: "0x00",
- value: ethers.toBeHex(ethers.parseUnits(value, "ether")),
- }
-
- //Serializing the transaction to pass it to Ledger Nano for signing
- let unsignedTx = ethers.Transaction.from(transaction).unsignedSerialized.substring(2);
- const resolution = await ledgerService.resolveTransaction(unsignedTx, {}, {});
-
- //Sign with the Ledger Nano (Sign what you see)
- const signature = await _eth.signTransaction("44'/60'/0'/0/0",unsignedTx, resolution);
-
- //Serialize the same transaction as before, but adding the parsed signature on it
- let signedTx = ethers.Transaction.from({...transaction,
- signature: {
- r: "0x"+signature.r,
- s: "0x"+signature.s,
- v: parseInt(signature.v),
- },
- }).serialized;
+ //Getting information from the inputs
+ addressWallet = document.getElementById("wallet").value;
+ recipient = document.getElementById("recipient").value;
+ value = document.getElementById("value").value;
+ gasLimit = parseInt(document.getElementById("gasLimit").value);
+ nonce = await provider.getTransactionCount(addressWallet, "latest");
+
+ //Building transaction with the information gathered
+ const transaction = {
+ to: recipient,
+ gasPrice: "0x" + parseInt(gasPrice).toString(16),
+ gasLimit: ethers.toBeHex(gasLimit),
+ nonce: nonce,
+ chainId: chainId,
+ data: "0x00",
+ value: ethers.toBeHex(ethers.parseUnits(value, "ether")),
+ };
+
+ //Serializing the transaction to pass it to Ledger Nano for signing
+ let unsignedTx =
+ ethers.Transaction.from(transaction).unsignedSerialized.substring(2);
+ const resolution = await ledgerService.resolveTransaction(unsignedTx, {}, {});
+
+ //Sign with the Ledger Nano (Sign what you see)
+ const signature = await _eth.signTransaction(
+ "44'/60'/0'/0/0",
+ unsignedTx,
+ resolution,
+ );
+
+ //Serialize the same transaction as before, but adding the parsed signature on it
+ let signedTx = ethers.Transaction.from({
+ ...transaction,
+ signature: {
+ r: "0x" + signature.r,
+ s: "0x" + signature.s,
+ v: parseInt(signature.v),
+ },
+ }).serialized;
- //Sending the transaction to the blockchain
- const hash = (await provider.broadcastTransaction(signedTx)).hash;
+ //Sending the transaction to the blockchain
+ const hash = (await provider.broadcastTransaction(signedTx)).hash;
- //Display the Sepolia etherscan on the screen
- const url = "https://sepolia.etherscan.io/tx/" + hash;
- document.getElementById("url").innerHTML = url;
-}
+ //Display the Sepolia etherscan on the screen
+ const url = "https://sepolia.etherscan.io/tx/" + hash;
+ document.getElementById("url").innerHTML = url;
+};
```
#### style.css
@@ -246,30 +303,31 @@ document.getElementById("tx-transfer").onclick = async function () {
In style.css copy-paste the following code :
```css copy
-.modal-content{
- width: 300px;
- height: 400px;
+.modal-content {
+ width: 300px;
+ height: 400px;
}
-#connect-ledger{
- width: 17rem;
- height: 9rem;
- background-color: white;
- border: none;
+#connect-ledger {
+ width: 17rem;
+ height: 9rem;
+ background-color: white;
+ border: none;
}
-#connect-ledger:hover{
- background-color: #EDEFF3;
+#connect-ledger:hover {
+ background-color: #edeff3;
}
-.modal-body{
- background-color: #F7F9FD;
+.modal-body {
+ background-color: #f7f9fd;
}
-#url,.url{
- text-align: center;
- margin-top: 160px;
- color: green;
+#url,
+.url {
+ text-align: center;
+ margin-top: 160px;
+ color: green;
}
```
@@ -286,13 +344,12 @@ npm install --save @ledgerhq/hw-transport-webhid
npm install --save ethers
```
-| Package | What does it do? |
-| ------- | ---------------- |
-| [parcel](https://parceljs.org/) | It is a build tool that will help you package your application to run it in the browser.|
-| [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It will help you ask your Ledger Nano to access the ethereum address. |
+| Package | What does it do? |
+| -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
+| [parcel](https://parceljs.org/) | It is a build tool that will help you package your application to run it in the browser. |
+| [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It will help you ask your Ledger Nano to access the ethereum address. |
| [@ledgerhq/hw-transport-webhid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webhid) | It provides you with all the methods to interact with your Ledger with an HID connexion. |
-| [ethers](https://docs.ethers.io/v5/) | It provides you with all the methods to interact with the ethereum blockchain. |
-
+| [ethers](https://docs.ethers.io/v5/) | It provides you with all the methods to interact with the ethereum blockchain. |
#### Modify Package.json
@@ -343,6 +400,7 @@ Your file should now look like this:
## Tutorial Test
### Start the Development Server
+
Now that the Setup is finished, the app has to be built to be displayed.
Start the development server:
@@ -353,72 +411,87 @@ npm run start
Now the application is up and running. Open the browser and go to `localhost:1234`, it will display :

-*Fig. 5: Application Running on Browser*
+_Fig. 5: Application Running on Browser_
### Plug Your Ledger Device
+
Before clicking on the text connect your Ledger to the USB port, unlock it and run the ethereum application.
The steps are described below.
-
+
-
- Fig. 6: Nano Enter Code Pin
+
+
+ Fig. 6: Nano Enter Code Pin
+
-
+
-
- Fig. 7: Run Ethereum Application on Ledger Nano
+
+
+ Fig. 7: Run Ethereum Application on Ledger Nano
+
-
+
-
- Fig. 8: Ethereum Application is Running on Ledger Nano
+
+
+ Fig. 8: Ethereum Application is Running on Ledger Nano
+
### Connect Your Ledger to the Application
+
Now you can click on the "Connect your Wallet" button and a modal will be opened.
Click on the Ledger logo.

-*Fig. 9: Choice of Wallet*
+_Fig. 9: Choice of Wallet_
Now choose the Ledger Nano to connect it to the browser.

-*Fig. 10: Connect the Ledger Nano*
+_Fig. 10: Connect the Ledger Nano_
If all goes well, the input fields will be filled with data. The greyed input is not to be changed and it is directly extracted either from the blockchain or from your Ledger Embedded application.

-*Fig. 11: Application After Connecting Ledger Nano*
-
+_Fig. 11: Application After Connecting Ledger Nano_
### Create a transaction to transfer ethereum
Now that the inputs are filled with data. It is time to transfer some ether tokens from your Ledger ethereum account to another account (you can keep the default account on the "index.js" file).
-Therefore, click on "Create Transaction" to create the transaction which will be signed by your ledger before sending it to the blockchain.
+Therefore, click on "Create Transaction" to create the transaction which will be signed by your ledger before sending it to the blockchain.

-*Fig. 12: Application After Connecting Ledger Nano*
+_Fig. 12: Application After Connecting Ledger Nano_
When the transaction proceed and finalize, an URL will be displayed on the screen. This URL is a link to Ropsten Etherscan to review the transaction.
There you can find all the information concerning the transaction you have previously sent.

-*Fig. 13: Result after Sending Transaction*
+_Fig. 13: Result after Sending Transaction_
If you go on Etherscan you can see the information of your transaction.

-*Fig. 14: Transaction Information on Sepolia Etherscan*
-
+_Fig. 14: Transaction Information on Sepolia Etherscan_
-Congratulations, you have successfully built your first transfer application connected with Ledger !!!
\ No newline at end of file
+Congratulations, you have successfully built your first transfer application connected with Ledger !!!
diff --git a/apps/docs/pages/docs/ledgerjs/beginner/transfer-sol.mdx b/apps/docs/pages/docs/ledgerjs/beginner/transfer-sol.mdx
index e13b3cf48..b61b9de50 100644
--- a/apps/docs/pages/docs/ledgerjs/beginner/transfer-sol.mdx
+++ b/apps/docs/pages/docs/ledgerjs/beginner/transfer-sol.mdx
@@ -3,19 +3,21 @@ title: Transfer of Sol between accounts
description: In this section, we will guide you through the creation of an application. This application will create a transaction that will be signed with the Ledger Nano before sending it to the blockchain.
---
-import Image from 'next/image'
-
+import Image from "next/image";
# Transfer of Sol between accounts
## Introduction
+
In this section, we will guide you through the creation of an application. This application will create a transaction that will be signed with the Ledger Nano before sending it to the blockchain.
The purpose of the application is to transfer sol from your solana account on your Ledger to another account.
## Tutorial Prerequisites
+
Before startint, make sure you have gone through the [prerequisites](../getting-started#prerequisites).
### Install the Solana Embedded App
+
First you need to install the Solana Embedded App from Ledger Live as shown in the [prerequisites](../getting-started#prerequisites) for Ethereum.
## Tutorial implementation
@@ -23,6 +25,7 @@ First you need to install the Solana Embedded App from Ledger Live as shown in t
In this implementation, we will be building a web application with vanilla javascript that uses the USB protocol from a [Ledger package](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webusb) to communicate with the ledger.
### Project Initialization
+
It is time to implement the application and test it. First, open a terminal and create a new folder. For this tutorial, the folder will be named "e2e-sol-tutorial”.
Run:
@@ -50,10 +53,10 @@ mkdir assets
Put [the logo](../faq/ledger-logos) in the assets folder and name it `ledger-logo`.
-The folder will contain these files:
+The folder will contain these files:

-*Fig. 1: Folder of the Application*
+_Fig. 1: Folder of the Application_
### Code Implementation
@@ -67,19 +70,38 @@ In index.html copy-paste the following code :
Parcel Sandbox
-
-
-
+
+
+
-
+
Click on the bellow button to connect your Ledger Wallet
- Connect your Wallet
- Get Information
+
+ Connect your Wallet
+
+
+ Get Information
+
@@ -87,46 +109,71 @@ In index.html copy-paste the following code :
-
+
-
+
-
+
-
-
+
+
-
+
- Create Transaction
+
+ Create Transaction
+
-
Solana explorer:
-
+
Solana explorer:
+
-
+
-
Choose your Wallet
-
+
+ Choose your Wallet
+
+
-
-
+
+
@@ -136,20 +183,22 @@ In index.html copy-paste the following code :
```
-
#### index.js
In index.js copy-paste the following code :
```javascript copy
-import * as SolanaWeb3 from '@solana/web3.js';
+import * as SolanaWeb3 from "@solana/web3.js";
import TransportWebUSB from "@ledgerhq/hw-transport-webusb";
import Solana from "@ledgerhq/hw-app-solana";
import { listen } from "@ledgerhq/logs";
import bs58 from "bs58";
//Infuria provider for Solana devnet network
-const connection = new SolanaWeb3.Connection(SolanaWeb3.clusterApiUrl('devnet'),"confirmed");
+const connection = new SolanaWeb3.Connection(
+ SolanaWeb3.clusterApiUrl("devnet"),
+ "confirmed",
+);
let transport;
let _sol;
@@ -159,71 +208,77 @@ let value = 0.1;
let gasPrice;
//listen to all errors thrown by the Transport
-listen(log => console.log(log));
+listen((log) => console.log(log));
document.getElementById("connect-ledger").onclick = async function () {
- //Connecting to the Ledger Nano with USB protocol
- transport = await TransportWebUSB.create();
-}
+ //Connecting to the Ledger Nano with USB protocol
+ transport = await TransportWebUSB.create();
+};
document.getElementById("get-information").onclick = async function () {
- //Getting an Solana instance and get the Ledger Nano solana account public key
- _sol = new Solana(transport);
- const { address } = await _sol.getAddress("44'/501'/0'");
- addressWallet = new SolanaWeb3.PublicKey(bs58.encode(address));
-
- //Get some properties from provider
- const balance = await connection.getBalance(addressWallet);
- gasPrice = SolanaWeb3.LAMPORTS_PER_SOL / 100;
-
- //Fill the inputs with the default value
- document.getElementById("wallet").value = bs58.encode(address);
- document.getElementById("balance").value = balance/ SolanaWeb3.LAMPORTS_PER_SOL;
- document.getElementById("gasPrice").value = parseInt(gasPrice) + " wei";
- document.getElementById("value").value = value;
- document.getElementById("recipient").value = recipient.toBase58();
-}
-
+ //Getting an Solana instance and get the Ledger Nano solana account public key
+ _sol = new Solana(transport);
+ const { address } = await _sol.getAddress("44'/501'/0'");
+ addressWallet = new SolanaWeb3.PublicKey(bs58.encode(address));
+
+ //Get some properties from provider
+ const balance = await connection.getBalance(addressWallet);
+ gasPrice = SolanaWeb3.LAMPORTS_PER_SOL / 100;
+
+ //Fill the inputs with the default value
+ document.getElementById("wallet").value = bs58.encode(address);
+ document.getElementById("balance").value =
+ balance / SolanaWeb3.LAMPORTS_PER_SOL;
+ document.getElementById("gasPrice").value = parseInt(gasPrice) + " wei";
+ document.getElementById("value").value = value;
+ document.getElementById("recipient").value = recipient.toBase58();
+};
document.getElementById("tx-transfer").onclick = async function () {
- //Getting information from the inputs
- recipient = new SolanaWeb3.PublicKey(document.getElementById("recipient").value);
- value = document.getElementById("value").value;
-
- //Building transaction with the information gathered
- try {
- const recentBlockhash = await connection.getRecentBlockhash();
- const transaction = new SolanaWeb3.Transaction({ feePayer: addressWallet, recentBlockhash: recentBlockhash.blockhash}).add(
- SolanaWeb3.SystemProgram.transfer({
- fromPubkey: addressWallet,
- toPubkey: recipient,
- lamports: SolanaWeb3.LAMPORTS_PER_SOL * value,
- }),
- );
-
-
- //Serializing the transaction to pass it to Ledger Nano for signing
- const unsignedTx = transaction.serializeMessage();
-
- //Sign with the Ledger Nano (Sign what you see)
- const { signature } = await _sol.signTransaction("44'/501'/0'", unsignedTx);
- transaction.addSignature(addressWallet,signature);
-
- //Serialize the same transaction as before, but added the signature on it
- const signedTx = transaction.serialize();
-
-
- //Sending the transaction to the blockchain
- const hash = await connection.sendRawTransaction(signedTx, {preflightCommitment:"confirmed", skipPreflight: false});
-
- //Display the Solana explorer url on the screen
- const url = "https://explorer.solana.com/tx/" + hash +"?cluster=devnet";
- document.getElementById("url").innerHTML = url;
- document.getElementById("url").href = url;
- } catch (error) {
- console.log(error);
- }
-}
+ //Getting information from the inputs
+ recipient = new SolanaWeb3.PublicKey(
+ document.getElementById("recipient").value,
+ );
+ value = document.getElementById("value").value;
+
+ //Building transaction with the information gathered
+ try {
+ const recentBlockhash = await connection.getRecentBlockhash();
+ const transaction = new SolanaWeb3.Transaction({
+ feePayer: addressWallet,
+ recentBlockhash: recentBlockhash.blockhash,
+ }).add(
+ SolanaWeb3.SystemProgram.transfer({
+ fromPubkey: addressWallet,
+ toPubkey: recipient,
+ lamports: SolanaWeb3.LAMPORTS_PER_SOL * value,
+ }),
+ );
+
+ //Serializing the transaction to pass it to Ledger Nano for signing
+ const unsignedTx = transaction.serializeMessage();
+
+ //Sign with the Ledger Nano (Sign what you see)
+ const { signature } = await _sol.signTransaction("44'/501'/0'", unsignedTx);
+ transaction.addSignature(addressWallet, signature);
+
+ //Serialize the same transaction as before, but added the signature on it
+ const signedTx = transaction.serialize();
+
+ //Sending the transaction to the blockchain
+ const hash = await connection.sendRawTransaction(signedTx, {
+ preflightCommitment: "confirmed",
+ skipPreflight: false,
+ });
+
+ //Display the Solana explorer url on the screen
+ const url = "https://explorer.solana.com/tx/" + hash + "?cluster=devnet";
+ document.getElementById("url").innerHTML = url;
+ document.getElementById("url").href = url;
+ } catch (error) {
+ console.log(error);
+ }
+};
```
#### style.css
@@ -231,30 +286,31 @@ document.getElementById("tx-transfer").onclick = async function () {
In style.css copy-paste the following code :
```css copy
-.modal-content{
- width: 300px;
- height: 400px;
+.modal-content {
+ width: 300px;
+ height: 400px;
}
-#connect-ledger{
- width: 17rem;
- height: 9rem;
- background-color: white;
- border: none;
+#connect-ledger {
+ width: 17rem;
+ height: 9rem;
+ background-color: white;
+ border: none;
}
-#connect-ledger:hover{
- background-color: #EDEFF3;
+#connect-ledger:hover {
+ background-color: #edeff3;
}
-.modal-body{
- background-color: #F7F9FD;
+.modal-body {
+ background-color: #f7f9fd;
}
-#url,.url{
- text-align: center;
- margin-top: 160px;
- color: green;
+#url,
+.url {
+ text-align: center;
+ margin-top: 160px;
+ color: green;
}
```
@@ -272,15 +328,15 @@ npm install --save @ledgerhq/logs
npm install --save @solana/web3.js
npm install --save bs58
```
-| Package | What does it do? |
-| ------- | ---------------- |
-| [parcel](https://parceljs.org/) | It is a build tool that will help you package your application to run it in the browser.|
-| [@ledgerhq/hw-app-solana](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-solana) | It will help you ask your Ledger Nano to access the solana application on the Ledger Nano. |
-| [@ledgerhq/hw-transport-webusb](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webusb) | It provides you with all the methods to interact with your Ledger with an USB connexion. |
-| [@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It provides you the log of all the error from your connexion with your Ledger device that may appear when developing. |
-| [@solana/web3.js](https://solana-labs.github.io/solana-web3.js/index.html) | It provides you with all the methods to interact with the solana blockchain. |
-| [bs58](https://www.npmjs.com/package/bs58) | It provides you with all the methods to compute base 58 encoding. |
+| Package | What does it do? |
+| -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
+| [parcel](https://parceljs.org/) | It is a build tool that will help you package your application to run it in the browser. |
+| [@ledgerhq/hw-app-solana](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-solana) | It will help you ask your Ledger Nano to access the solana application on the Ledger Nano. |
+| [@ledgerhq/hw-transport-webusb](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webusb) | It provides you with all the methods to interact with your Ledger with an USB connexion. |
+| [@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It provides you the log of all the error from your connexion with your Ledger device that may appear when developing. |
+| [@solana/web3.js](https://solana-labs.github.io/solana-web3.js/index.html) | It provides you with all the methods to interact with the solana blockchain. |
+| [bs58](https://www.npmjs.com/package/bs58) | It provides you with all the methods to compute base 58 encoding. |
#### Modify Package.json
@@ -302,7 +358,6 @@ Add this at the end of the script:
}
```
-
Your file should know look like this:
```javascript copy
@@ -335,6 +390,7 @@ Your file should know look like this:
## Tutorial Test
### Start the Development Server
+
Now that the Setup is finished, the app has to be built to be displayed.
Start the development server:
@@ -345,75 +401,98 @@ npm run start
Now the application is up and running. Open Chrome and go to `localhost:1234`, it will display :

-*Fig. 2: Application Running on Browser*
+_Fig. 2: Application Running on Browser_
### Plug Your Ledger Device
+
Before clicking on the text connect your Ledger to the USB port, unlock it and run the solana application.
The steps are described below.
-
+
-
- Fig. 3: Ledger Enter Code Pin
+
+
+ Fig. 3: Ledger Enter Code Pin
+
-
+
-
- Fig. 4: Run Solana Application on Ledger Nano
+
+
+ Fig. 4: Run Solana Application on Ledger Nano
+
-
+
-
- Fig. 5: Solana Application is Running on Ledger Nano
+
+
+ Fig. 5: Solana Application is Running on Ledger Nano
+
### Connect Your Ledger to the Application
+
Now you can click on the "Connect your Wallet" button and a modal will be opened.
Click on the Ledger logo.
-
-*Fig. 6: Choice of Wallet*
+
+_Fig. 6: Choice of Wallet_
Now choose the Ledger Nano to connect it to the browser.

-*Fig. 7: Connect the Ledger Nano*
+_Fig. 7: Connect the Ledger Nano_
After connecting the Nano, click on "Get Information". If all goes well, the input fields will be filled with data. The greyed input is not to be changed and it is directly extracted either from the blockchain or from your Ledger Embedded application.

-*Fig. 8: Application After Connecting Ledger Nano*
+_Fig. 8: Application After Connecting Ledger Nano_
### Send Sol token to your Ledger Nano solana account
+
To send some sol tokens on the Devnet network, you can either go to one of the solana faucet websites or do it with the solana cli:
+
- [Solana Faucet](https://solfaucet.com/)
- [Solana CLI](https://docs.solana.com/cli/transfer-tokens)
If you are looking for the easier and quicker way, use the Solana Faucet. If you would rather use the Solana CLI, please read this documentation to [install it](https://docs.solana.com/cli) before starting sending Sol.
-The Solana Devnet is not visible on Ledger Live, you can then check the transaction passed on [the Solana Explorer](https://explorer.solana.com/?cluster=devnet).
+The Solana Devnet is not visible on Ledger Live, you can then check the transaction passed on [the Solana Explorer](https://explorer.solana.com/?cluster=devnet).
#### Option n°1 - Solana Faucet
+
Go to the [Solana Faucet](https://solfaucet.com/) website put your Wallet Public Key (displayed on the web app) on the input and click on "Devnet"

-*Fig. 9: Solana Faucet*
+_Fig. 9: Solana Faucet_
#### Option n°2 -Solana CLI
+
Go to the [Solana CLI](https://docs.solana.com/cli/transfer-tokens) website, there are the steps to add some sol to your account.
```console copy
solana airdrop 1 --url https://api.devnet.solana.com
```
+
For example
+
```console copy
solana airdrop 1 72tCcW6F4gRWJLCXf3RGejNDZBwUvWCfxHTdxoLGV4ht --url https://api.devnet.solana.com
```
@@ -421,24 +500,23 @@ solana airdrop 1 72tCcW6F4gRWJLCXf3RGejNDZBwUvWCfxHTdxoLGV4ht --url https://api.
### Create a transaction to transfer sol
Now that the inputs are filled with data. It is time to transfer some sol tokens from your Ledger solana account to another account (you can keep the default account on the "index.js" file).
-Therefore, click on "Create Transaction" to create the transaction which will be signed by your ledger before sending it to the blockchain.
+Therefore, click on "Create Transaction" to create the transaction which will be signed by your ledger before sending it to the blockchain.

-*Fig. 10: Application After Connecting Ledger Nano*
+_Fig. 10: Application After Connecting Ledger Nano_
When the transaction proceed and finalize, an URL will be displayed on the screen. This URL is a link to Solana Explorer to review the transaction.
There you can find all the information concerning the transaction you have previously sent.

-*Fig. 11: Transaction Information URL*
+_Fig. 11: Transaction Information URL_
If you go on Solana Explorer you can see the information of your transaction.

-*Fig. 12: Result on Solana Explorer after Sending Transaction*
+_Fig. 12: Result on Solana Explorer after Sending Transaction_

-*Fig. 13: Result on Solana Explorer after Sending Transaction*
-
+_Fig. 13: Result on Solana Explorer after Sending Transaction_
-Congratulations, you have successfully built your first transfer application connected with Ledger !!!
\ No newline at end of file
+Congratulations, you have successfully built your first transfer application connected with Ledger !!!
diff --git a/apps/docs/pages/docs/ledgerjs/explanation/architecture-diagram.mdx b/apps/docs/pages/docs/ledgerjs/explanation/architecture-diagram.mdx
index c1ff01107..68c5a038b 100644
--- a/apps/docs/pages/docs/ledgerjs/explanation/architecture-diagram.mdx
+++ b/apps/docs/pages/docs/ledgerjs/explanation/architecture-diagram.mdx
@@ -7,10 +7,10 @@ discription: Understand how your application will interact with a device app.
## Application architecture
-### Architecture Overview
+### Architecture Overview

-*Fig. 1: Overall Architecture*
+_Fig. 1: Overall Architecture_
On the client side we have your core application containing your business logic and workflows.
You need to integrate at least the Device Management Kit or the LedgerJS Transport libraries in order to discuss with the Ledger device.
@@ -18,7 +18,6 @@ You need to integrate at least the Device Management Kit or the LedgerJS Transpo
Some major networks have dedicated JS Library, like Bitcoin / Ethereum. You should use them if you are planning to integrate with these apps. This will provide a good abstraction level and allow you to use a proper SDK.
You can see how to use them in [Integration Walkthrough - Web USB/HID](../guides/web-application/web-hid-usb/).
-
### Nano API calls
This section describes what are the role of the Nano API.
@@ -37,20 +36,19 @@ You can also see the different Nano API provided by Ledger below.
Here is the list of all the APIs provided by Ledger.
-| Blockchain | Nano API |
-|-------------|--------------|
-|Algorand | [](https://www.npmjs.com/package/@ledgerhq/hw-app-algorand) [@ledgerhq/hw-app-algorand](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-algorand) |
-|Bitcoin | [](https://www.npmjs.com/package/@ledgerhq/hw-app-btc) [@ledgerhq/hw-app-btc](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-btc) |
-|Cosmos | [](https://www.npmjs.com/package/@ledgerhq/hw-app-cosmos) [@ledgerhq/hw-app-cosmos](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-cosmos) |
-|Elrond | [](https://www.npmjs.com/package/@ledgerhq/hw-app-elrond) [@ledgerhq/hw-app-elrond](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledger-live-common/src/families/elrond/hw-app-elrond) |
-|Ethereum | [](https://www.npmjs.com/package/@ledgerhq/hw-app-eth) [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) |
-|Polkadot | [](https://www.npmjs.com/package/@ledgerhq/hw-app-polkadot) [@ledgerhq/hw-app-polkadot](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-polkadot) |
-|Solana | [](https://www.npmjs.com/package/@ledgerhq/hw-app-solana) [@ledgerhq/hw-app-solana](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-solana) |
-|Stellar | [](https://www.npmjs.com/package/@ledgerhq/hw-app-str) [@ledgerhq/hw-app-str](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-str) |
-|Tezos | [](https://www.npmjs.com/package/@ledgerhq/hw-app-tezos) [@ledgerhq/hw-app-tezos](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-tezos) |
-|Tron | [](https://www.npmjs.com/package/@ledgerhq/hw-app-trx) [@ledgerhq/hw-app-trx](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-trx) |
-|Ripple | [](https://www.npmjs.com/package/@ledgerhq/hw-app-xrp) [@ledgerhq/hw-app-xrp](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-xrp) |
-
+| Blockchain | Nano API |
+| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Algorand | [](https://www.npmjs.com/package/@ledgerhq/hw-app-algorand) [@ledgerhq/hw-app-algorand](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-algorand) |
+| Bitcoin | [](https://www.npmjs.com/package/@ledgerhq/hw-app-btc) [@ledgerhq/hw-app-btc](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-btc) |
+| Cosmos | [](https://www.npmjs.com/package/@ledgerhq/hw-app-cosmos) [@ledgerhq/hw-app-cosmos](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-cosmos) |
+| Elrond | [](https://www.npmjs.com/package/@ledgerhq/hw-app-elrond) [@ledgerhq/hw-app-elrond](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledger-live-common/src/families/elrond/hw-app-elrond) |
+| Ethereum | [](https://www.npmjs.com/package/@ledgerhq/hw-app-eth) [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) |
+| Polkadot | [](https://www.npmjs.com/package/@ledgerhq/hw-app-polkadot) [@ledgerhq/hw-app-polkadot](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-polkadot) |
+| Solana | [](https://www.npmjs.com/package/@ledgerhq/hw-app-solana) [@ledgerhq/hw-app-solana](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-solana) |
+| Stellar | [](https://www.npmjs.com/package/@ledgerhq/hw-app-str) [@ledgerhq/hw-app-str](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-str) |
+| Tezos | [](https://www.npmjs.com/package/@ledgerhq/hw-app-tezos) [@ledgerhq/hw-app-tezos](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-tezos) |
+| Tron | [](https://www.npmjs.com/package/@ledgerhq/hw-app-trx) [@ledgerhq/hw-app-trx](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-trx) |
+| Ripple | [](https://www.npmjs.com/package/@ledgerhq/hw-app-xrp) [@ledgerhq/hw-app-xrp](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-xrp) |
#### Nano APIs provided by the crypto-asset community
@@ -60,12 +58,12 @@ We currently do not have an updated list of all community-developed Nano APIs. I
Here is the list of all the APIs from the community that you can find on npm.
-| Blockchain | Nano API |
-|-------------|--------------|
-|Vite | [](https://www.npmjs.com/package/@vite/ledgerjs-hw-app-vite) [ledgerjs-hw-app-vite](https://github.com/vitelabs/ledgerjs-hw-app-vite) |
-|Ergo | [](https://www.npmjs.com/package/ledgerjs-hw-app-ergo) [ledgerjs-hw-app-ergo](https://github.com/tesseract-one/ledger-app-ergo) |
-|Cardano | [](https://www.npmjs.com/package/@cardano-foundation/ledgerjs-hw-app-cardano) [@cardano-foundation/ledgerjs-hw-app-cardano](https://github.com/cardano-foundation/ledger-app-cardano) |
-|Sia | [](https://www.npmjs.com/package/@siacentral/ledgerjs-sia) [@siacentral/ledgerjs-sia](https://github.com/siacentral/ledgerjs-sia) |
+| Blockchain | Nano API |
+| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Vite | [](https://www.npmjs.com/package/@vite/ledgerjs-hw-app-vite) [ledgerjs-hw-app-vite](https://github.com/vitelabs/ledgerjs-hw-app-vite) |
+| Ergo | [](https://www.npmjs.com/package/ledgerjs-hw-app-ergo) [ledgerjs-hw-app-ergo](https://github.com/tesseract-one/ledger-app-ergo) |
+| Cardano | [](https://www.npmjs.com/package/@cardano-foundation/ledgerjs-hw-app-cardano) [@cardano-foundation/ledgerjs-hw-app-cardano](https://github.com/cardano-foundation/ledger-app-cardano) |
+| Sia | [](https://www.npmjs.com/package/@siacentral/ledgerjs-sia) [@siacentral/ledgerjs-sia](https://github.com/siacentral/ledgerjs-sia) |
### Nano API-less calls
@@ -73,23 +71,20 @@ When there is no available Nano API, the way to make your Nano calls is by const
Here are some examples:
-| Blockchain App | Application documentation |
-|-------------|--------------|
-| Polymath | [Polymath](https://github.com/LedgerHQ/app-polymesh/blob/master/docs/APDUSPEC.md) |
-| Filecoin | [Filecoin](https://github.com/LedgerHQ/app-filecoin/blob/master/docs/APDUSPEC.md) |
-
+| Blockchain App | Application documentation |
+| -------------- | --------------------------------------------------------------------------------- |
+| Polymath | [Polymath](https://github.com/LedgerHQ/app-polymesh/blob/master/docs/APDUSPEC.md) |
+| Filecoin | [Filecoin](https://github.com/LedgerHQ/app-filecoin/blob/master/docs/APDUSPEC.md) |
## Dataflow architecture
-
### Dataflow Overview
During a transaction handled by Ledger Device several exchanges are done between different application & hardware components.
These exchanges allow to read data from Ledger Device & Sign Transactions with internal private key without sharing it.

-*Fig. 1: Application Sequence Diagram*
-
+_Fig. 1: Application Sequence Diagram_
This diagram demonstrate the sequence of different calls done by each application layer during a transaction.
5 different layers are used to handle a transaction:
diff --git a/apps/docs/pages/docs/ledgerjs/info.mdx b/apps/docs/pages/docs/ledgerjs/info.mdx
index 002b9f552..48ac34122 100644
--- a/apps/docs/pages/docs/ledgerjs/info.mdx
+++ b/apps/docs/pages/docs/ledgerjs/info.mdx
@@ -1,12 +1,11 @@
-import { Callout } from 'nextra/components'
-import Image from 'next/image'
-
+import { Callout } from "nextra/components";
+import Image from "next/image";
# Info note
-LedgerJS Transport libraries will soon be deprecated.
+LedgerJS Transport libraries will soon be deprecated.
For any new project, we recommend you use the new Device Management Kit.
@@ -14,21 +13,20 @@ For existing projects, you can still access the LedgerJS documentation but we re
-
## Languages
-| Type of App | Required skills |
-|-------------|------------------|
-| Web App | JavaScript |
+| Type of App | Required skills |
+| ----------- | ---------------- |
+| Web App | JavaScript |
| Mobile App | React Native |
| Desktop App | Electron/Node.js |
## Prerequisites
-
### Summary
To connect your app you will need to install:
+
- [Node (for Desktop apps) and NPM](#node-and-npm)
- [Ledger Live](#ledger-live-installation)
- [The Ledger Embedded App](#embedded-app-installation) of the coin that you are going to use (to use this documentation you will need Bitcoin, Ethereum and Solana)
@@ -46,23 +44,29 @@ $ npm -v
10.5.0
```
-The commands should print the versions of Node.js and npm accordingly. Ensure Node.JS is 20.9.0.
+The commands should print the versions of Node.js and npm accordingly. Ensure Node.JS is 20.9.0.
+
+---
----------------------------------
### Ledger Live Installation
Now that node and npm are installed, you have to install the [Ledger Live](https://www.ledger.com/ledger-live) desktop application to connect your Ledger device.
After the installation, open Ledger Live and go to the **Manager** tab.

-*Fig. 1: Ledger Live Prerequisites*
+_Fig. 1: Ledger Live Prerequisites_
Then connect your Ledger Nano to your computer and unlock it.
@@ -70,15 +74,25 @@ Then Ledger Live will ask you to allow the Ledger device, just press the two but
-
- Fig. 3: Ledger Live Animation
+
+
+ Fig. 3: Ledger Live Animation
+
-
+
-
- Fig. 4: Ledger Live Notification on Ledger Device
+
+
+ Fig. 4: Ledger Live Notification on Ledger Device
+
@@ -87,56 +101,53 @@ Then Ledger Live will ask you to allow the Ledger device, just press the two but
Now you can install the Ethereum and bitcoin application into your Ledger Nano S/X/S Plus, as in the tutorials and walkthroughs, we will use the Ethereum and Bitcoin application.

-*Fig. 5: Ethereum App Installation*
-
+_Fig. 5: Ethereum App Installation_
### Account Creation
To use the Bitcoin/Ethereum Embedded Apps you have to create a Bitcoin/Ethereum account.
We will present there the creation of a bitcoin account but it is the same for any application supported by Ledger Live.
-
To create your Bitcoin account:
- Launch the Bitcoin application on your Ledger Nano S/X/S Plus
- Open the Bitcoin app on your ledger device
-
-
- Create an account by going to the **Manager** tab and click on **Add account**.

-*Fig. 8: Bitcoin App Add Account*
-
+_Fig. 8: Bitcoin App Add Account_
- Click on **Add account** button.

-*Fig. 9: Bitcoin Account Creation*
-
+_Fig. 9: Bitcoin Account Creation_
- Your account is created.

-*Fig. 10: Bitcoin Account Selection*
-
+_Fig. 10: Bitcoin Account Selection_
You have now a secured bitcoin account on your Ledger Device, congratulations!

-*Fig. 11: Bitcoin Account Created*
\ No newline at end of file
+_Fig. 11: Bitcoin Account Created_
diff --git a/apps/docs/pages/docs/ledgerjs/integration/_meta.js b/apps/docs/pages/docs/ledgerjs/integration/_meta.js
index b87e502ef..3e38e958d 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/_meta.js
+++ b/apps/docs/pages/docs/ledgerjs/integration/_meta.js
@@ -1,5 +1,5 @@
-export default {
- 'web-application': "Web Application",
- 'mobile-application': "Mobile Application",
- 'desktop-application': "Desktop Application"
-}
\ No newline at end of file
+export default {
+ "web-application": "Web Application",
+ "mobile-application": "Mobile Application",
+ "desktop-application": "Desktop Application",
+};
diff --git a/apps/docs/pages/docs/ledgerjs/integration/desktop-application/node-electron-hid.mdx b/apps/docs/pages/docs/ledgerjs/integration/desktop-application/node-electron-hid.mdx
index e8d1c676e..80c5af392 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/desktop-application/node-electron-hid.mdx
+++ b/apps/docs/pages/docs/ledgerjs/integration/desktop-application/node-electron-hid.mdx
@@ -3,12 +3,12 @@ title: Node HID integration
description: In this section, we will guide you through the creation of a desktop electron application. This application will be connected to your Nano to display the address of your account (eg. bitcoin account, ethereum account).
---
-import Image from 'next/image'
-
+import Image from "next/image";
# Node HID integration
## Introduction
+
In this section, we will guide you through the creation of a desktop electron application. This application will be connected to your Nano to display the address of your account (eg. bitcoin account, ethereum account).
Implementation for Web USB and Web HID on Nano S/X/S Plus.
@@ -17,7 +17,7 @@ For this application we will use the Ledger node hid package which is [@ledgerhq
## One-time setup
-### Environment
+### Environment
Make sure you have gone through the [prerequisites](../../getting-started#prerequisites).
@@ -50,10 +50,10 @@ touch main.js
touch renderer.js
```
-The folder will contain these files:
+The folder will contain these files:

-*Fig. 1: Folder of the Application*
+_Fig. 1: Folder of the Application_
### Files
@@ -103,7 +103,6 @@ const TransportNodeHid = require("@ledgerhq/hw-transport-node-hid").default;
const AppBtc = require("@ledgerhq/hw-app-btc").default;
const { listen } = require("@ledgerhq/logs");
-
const { app, BrowserWindow, ipcMain } = require("electron");
// This a very basic example
@@ -111,21 +110,26 @@ const { app, BrowserWindow, ipcMain } = require("electron");
// but run it in a dedicated node.js process
function getBitcoinInfo(verify) {
return TransportNodeHid.open("")
- .then(transport => {
- listen(log => console.log(log))
+ .then((transport) => {
+ listen((log) => console.log(log));
const appBtc = new AppBtc({ transport, currency: "bitcoin" });
- return appBtc.getWalletPublicKey("44'/0'/0'/0/0",{verify: verify, format: "legacy"}).then(r =>
- transport
- .close()
- .catch(e => {})
- .then(() => r)
- );
+ return appBtc
+ .getWalletPublicKey("44'/0'/0'/0/0", {
+ verify: verify,
+ format: "legacy",
+ })
+ .then((r) =>
+ transport
+ .close()
+ .catch((e) => {})
+ .then(() => r),
+ );
})
- .catch(e => {
+ .catch((e) => {
console.warn(e);
// try again until success!
- return new Promise(s => setTimeout(s, 1000)).then(() =>
- getBitcoinInfo(verify)
+ return new Promise((s) => setTimeout(s, 1000)).then(() =>
+ getBitcoinInfo(verify),
);
});
}
@@ -138,10 +142,10 @@ function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
webPreferences: {
- nodeIntegration: true,
- contextIsolation: false
- }
-})
+ nodeIntegration: true,
+ contextIsolation: false,
+ },
+ });
// and load the index.html of the app.
mainWindow.loadFile("index.html");
@@ -150,7 +154,7 @@ function createWindow() {
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
- mainWindow.on("closed", function() {
+ mainWindow.on("closed", function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
@@ -160,7 +164,7 @@ function createWindow() {
// ~~~ BASIC LEDGER EXAMPLE ~~~
ipcMain.on("requestBitcoinInfo", () => {
- getBitcoinInfo(false).then(result => {
+ getBitcoinInfo(false).then((result) => {
mainWindow.webContents.send("bitcoinInfo", result);
});
});
@@ -178,7 +182,7 @@ function createWindow() {
app.on("ready", createWindow);
// Quit when all windows are closed.
-app.on("window-all-closed", function() {
+app.on("window-all-closed", function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== "darwin") {
@@ -186,7 +190,7 @@ app.on("window-all-closed", function() {
}
});
-app.on("activate", function() {
+app.on("activate", function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
@@ -236,14 +240,14 @@ npm install --save browserify
npm install --save @ledgerhq/hw-transport-node-hid
```
-| Package | What does it do? |
-| ------- | ---------------- |
-| [Electron](https://www.electronjs.org/) | It is a build tool that will help you package your application to run it as a desktop application. |
-| [Babel polyfill](https://www.npmjs.com/package/@babel/polyfill)| |
-| [@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It provides you with the log of all the error from your connexion with your Ledger device that may appear when developing. |
-| [@ledgerhq/hw-app-btc](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-btc) | It helps you ask your Ledger Nano to access the bitcoin address. |
-| [Browserify](https://browserify.org/) | It helps you use "require" like Node does. |
-| [@ledgerhq/hw-transport-node-hid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-node-hid) | It provides you with all the methods to interact with your Nano with an HID connexion. |
+| Package | What does it do? |
+| ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
+| [Electron](https://www.electronjs.org/) | It is a build tool that will help you package your application to run it as a desktop application. |
+| [Babel polyfill](https://www.npmjs.com/package/@babel/polyfill) | |
+| [@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It provides you with the log of all the error from your connexion with your Ledger device that may appear when developing. |
+| [@ledgerhq/hw-app-btc](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-btc) | It helps you ask your Ledger Nano to access the bitcoin address. |
+| [Browserify](https://browserify.org/) | It helps you use "require" like Node does. |
+| [@ledgerhq/hw-transport-node-hid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-node-hid) | It provides you with all the methods to interact with your Nano with an HID connexion. |
Since automatic polyfills have been removed in webpack 5, run the following command to avoid errors when building the app locally:
@@ -288,11 +292,13 @@ Your file should know look like this:
}
}
```
+
## App Launch
### 1. Launch the App
Now that the Setup is finished, let's start the application.
+
```console copy
node_modules/electron/dist/Electron.app/Contents/MacOS/Electron ./main.js
```
@@ -300,34 +306,44 @@ node_modules/electron/dist/Electron.app/Contents/MacOS/Electron ./main.js
Now the application is up and running. A window must have been launched on your machine, it will display:

-*Fig. 2: Node Desktop Application*
+_Fig. 2: Node Desktop Application_
### 2. Plug Your Nano and open Bitcoin App
+
Connect your Nano to the USB port, unlock it and open the Bitcoin application.
The steps are described below.
If you do not have a Bitcoin account, or you want to created one for the purposes of this walkthrough, you can [create one here](../../getting-started#account-creation).
-
+
-
- Fig. 3: Nano Enter Code Pin
+
+
+ Fig. 3: Nano Enter Code Pin
+
-
- Fig. 5: Nano Run Application
+
+
+ Fig. 5: Nano Run Application
+
@@ -336,6 +352,6 @@ If you do not have a Bitcoin account, or you want to created one for the purpose
Check that the address displayed on the App is the same as the one displayed on the Ledger device.

-*Fig. 6: Address Account Displayed*
+_Fig. 6: Address Account Displayed_
-Congratulations you have successfully built your first Node Electron HID application connected to your Ledger!
\ No newline at end of file
+Congratulations you have successfully built your first Node Electron HID application connected to your Ledger!
diff --git a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/environment-setup.mdx b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/environment-setup.mdx
index 1f7d2820c..55dc29446 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/environment-setup.mdx
+++ b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/environment-setup.mdx
@@ -1,48 +1,82 @@
-import { Callout } from 'nextra/components'
+import { Callout } from "nextra/components";
# Mobile Environment Setup
## Overview
-Make sure you have all of the following:
-
-
-{
}
----------------------------------
-## Setup
+---
+
+## Setup
### Development Environment
@@ -54,18 +88,18 @@ Choose the right version for your operating system.
When Android Studio is installed, open it.

-*Fig. 1: Android Studio Window*
+_Fig. 1: Android Studio Window_
Go to Settings => Appearance & Behaviour => System Settings => Android SDK
Check the "Show Package Details" checkbox on the bottom right of the windows.

-*Fig. 2: Android Studio Settings*
+_Fig. 2: Android Studio Settings_
Install the latest SDK version. Select the packages shown below and click apply.

-*Fig. 3: Android Studio SDK Settings*
+_Fig. 3: Android Studio SDK Settings_
#### Xcode
@@ -74,20 +108,21 @@ To develop an iOS application we have to install [Xcode](https://apps.apple.com/
When the installation is complete, open Xcode then go to Settings => Locations.

-*Fig. 1: Xcode Settings*
+_Fig. 1: Xcode Settings_
Select the most recent version from the "Command Line Tools" dropdown.

-*Fig. 2: Xcode Location Settings*
+_Fig. 2: Xcode Location Settings_
Finally, install cocoapods by running:
+
```console copy
sudo gem install cocoapods
```
-
### Install Homebrew
+
Homebrew is a package manager for macOS. When it needs to install software from third-party websites. To install it, run:
```console copy
@@ -95,6 +130,7 @@ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/
```
### Install Watchman
+
React Native uses watchman to detect real-time code changes and it automatically builds and pushes the update to your device without manually refreshing.
```console copy
@@ -102,14 +138,15 @@ brew install watchman
```
### Install Java JRE and JDK
- There is a risk of react-native build failure if you don’t have a complete installation of Java. Downloading Android Studio is not enough since it comes bundled with its own JRE.
+
+There is a risk of react-native build failure if you don’t have a complete installation of Java. Downloading Android Studio is not enough since it comes bundled with its own JRE.
```console copy
brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
```
-
### Install React Native
+
With React Native, you can write an application in Javascript and then the React Native Compiler will convert your Javascript code into native code for iOS and Android environments.
React Native command line interface can be installed using npm as below.
diff --git a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-android-hid.mdx b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-android-hid.mdx
index 67bba3386..5ea9355d1 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-android-hid.mdx
+++ b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-android-hid.mdx
@@ -3,13 +3,13 @@ title: React Native HID (Android only)
description: In this section, you will see how to create a React Native application using the @ledgerhq/react-native-hid (Only on Android).
---
-import { Callout } from 'nextra/components'
-import Image from 'next/image'
-
+import { Callout } from "nextra/components";
+import Image from "next/image";
# React Native HID (Android only)
## Introduction
+
In this section, you will see how to create a React Native application using the [@ledgerhq/react-native-hid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/react-native-hid) (Only on Android).
For this project some general prerequisites are mandatory and you can find them [here](../../getting-started#prerequisites).
@@ -19,11 +19,13 @@ Then you can now go through the prerequisite for Android development below.
### Environnement
-Make sure you go through:
+Make sure you go through:
+
1. the [Development Prerequisites](../../getting-started#prerequisites).
1. the [Mobile Environment Setup](./environment-setup).
### Environnement variables
+
If you are using bash, put the environment variable into the bash_profile as below:
```console copy
@@ -48,6 +50,7 @@ Now that we have set up the prerequisites, you can now create the application.
In this integration, we will use the ethereum application.
### App setup
+
First, open a terminal and create a new project. For this tutorial the project will be named “myAndroidHidApp”.
Run:
@@ -69,13 +72,19 @@ Run:
touch App.js
touch polyfill.js
```
+
Open your folder in a code editor, it must look like this.
-
+
-
- Fig. 4: Folder of the Application
+
+
+ Fig. 4: Folder of the Application
+
@@ -96,10 +105,10 @@ Then import the "polyfill.js" in "index.js" as shown below:
* @format
*/
-import "./polyfill"; //import this
-import {AppRegistry} from 'react-native';
-import App from './App';
-import {name as appName} from './app.json';
+import "./polyfill"; //import this
+import { AppRegistry } from "react-native";
+import App from "./App";
+import { name as appName } from "./app.json";
AppRegistry.registerComponent(appName, () => App);
```
@@ -116,18 +125,17 @@ import { listen } from "@ledgerhq/logs";
import TransportHID from "@ledgerhq/react-native-hid";
import AppEth from "@ledgerhq/hw-app-eth";
-
// This is helpful if you want to see BLE logs. (only to use in dev mode)
class App extends Component {
state = {
- transport: null
+ transport: null,
};
onSelectDevice = async () => {
try {
const transport = await TransportHID.create();
- listen(log => console.log(log));
+ listen((log) => console.log(log));
const eth = new AppEth(transport);
const path = "44'/60'/0'/0/0"; // HD derivation path
const { address } = await eth.getAddress(path, false);
@@ -141,25 +149,29 @@ class App extends Component {
render() {
const { transport } = this.state;
- if(!transport){
- return (
+ if (!transport) {
+ return (
Scanning for Ledger...
- {this.onSelectDevice()}}>
+ {
+ this.onSelectDevice();
+ }}
+ >
Power up your Ledger and enter your pin. Then tap the screen
);
- }else{
- return (
- Ledger Live Ethereum Account 1
-
- {transport}
-
-
+ } else {
+ return (
+
+ Ledger Live Ethereum Account 1
+ {transport}
+
);
}
- };
+ }
}
export default App;
@@ -168,27 +180,27 @@ const styles = StyleSheet.create({
header: {
paddingTop: 80,
paddingBottom: 36,
- alignItems: "center"
+ alignItems: "center",
},
headerTitle: {
fontSize: 22,
- marginBottom: 16
+ marginBottom: 16,
},
headerSubtitle: {
fontSize: 12,
- color: "#999"
+ color: "#999",
},
list: {
- flex: 1
+ flex: 1,
},
errorTitle: {
color: "#c00",
fontSize: 16,
- marginBottom: 16
- }
+ marginBottom: 16,
+ },
});
-
```
+
### Dependencies
#### Installation
@@ -202,13 +214,13 @@ npm install --save @ledgerhq/hw-app-eth
npm install --save @ledgerhq/hw-transport-webusb
```
-| Package | What it does |
-|---------|------------------|
-|[buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
-|[@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It helps you ask your Ledger device to access the ethereum address. |
-|[rxjs](https://www.npmjs.com/package/rxjs) | It is a rewrite of "Reactive-Extensions/RxJS" and is the latest production-ready version of RxJS. |
-|[@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It helps you ask your Ledger device to access the ethereum address.|
-| [@ledgerhq/react-native-hid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/react-native-hid) |It provides you with all the methods to interact with your Ledger with an HID connexion. |
+| Package | What it does |
+| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
+| [buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
+| [@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It helps you ask your Ledger device to access the ethereum address. |
+| [rxjs](https://www.npmjs.com/package/rxjs) | It is a rewrite of "Reactive-Extensions/RxJS" and is the latest production-ready version of RxJS. |
+| [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It helps you ask your Ledger device to access the ethereum address. |
+| [@ledgerhq/react-native-hid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/react-native-hid) | It provides you with all the methods to interact with your Ledger with an HID connexion. |
#### package.json
@@ -250,12 +262,13 @@ This is how your “package.json” must look like.
}
}
```
+
#### Build.gradle Modification
+
In “build.gradle”, in the "android" folder change `minSdkVersion = 21` to `minSdkVersion = 24`.

-*Fig. 5: Build.gradle Modify the minSdkVersion*
-
+_Fig. 5: Build.gradle Modify the minSdkVersion_
You can now test the application you have built.
@@ -264,48 +277,63 @@ You can now test the application you have built.
App testing is done on your smartphone because the Android Studio emulator cannot use Bluetooth or USB connexions.
- Please refer to the information for [Android Emulator Limitation](https://stackoverflow.com/questions/22604305/how-to-use-android-emulator-for-testing-bluetooth-application).
+ Please refer to the information for [Android Emulator
+ Limitation](https://stackoverflow.com/questions/22604305/how-to-use-android-emulator-for-testing-bluetooth-application).
### Enable Developer Settings
+
To integrate an application on your Android smartphone you have to enable the developer role.
-To do that go to Settings > About Phone > Build Number, and tap 7 times on build number to enable the developer settings.
+To do that go to Settings > About Phone > Build Number, and tap 7 times on build number to enable the developer settings.
-Then go to Settings > System > Advanced > Developer Options and enable the "USB debugging" as well as "Install via USB"
+Then go to Settings > System > Advanced > Developer Options and enable the "USB debugging" as well as "Install via USB"
Connect your phone to your computer, and run the command below to check your device is connected:
+
```console copy
adb devices
```
+
If all goes well, the list of devices is displayed as shown below:
-
+
-
- Fig. 6: Device Connected On The Machine
+
+
+ Fig. 6: Device Connected On The Machine
+
-
- For more information about enabling the developer settings on your android device go to [android studio docs](https://developer.android.com/studio/debug/dev-options).
+ For more information about enabling the developer settings on your android
+ device go to [android studio
+ docs](https://developer.android.com/studio/debug/dev-options).
### Start the Development Server
+
You can now open a terminal, go to the "myAndroidHidApp" folder, and start the server by running:
+
```console copy
npm start
```
### Install the App on Device
+
Keep the terminal where "metro" is running open and open a new terminal.
In this new terminal go to your app folder:
+
```console copy
cd myAndroidHidApp
```
-Run the command below to install the application on your android device. It assumes your smartphone is connected and your device is recognized by the command `adb devices` as mentioned in the [Previous Step](#enable-developer-settings).
+Run the command below to install the application on your android device. It assumes your smartphone is connected and your device is recognized by the command `adb devices` as mentioned in the [Previous Step](#enable-developer-settings).
+
```console copy
npm run android
```
@@ -313,53 +341,73 @@ npm run android
A window will pop up on your android device to install the application. Click on "Yes" to install it and run it.
### Launching the App
+
When launching the application it will be displayed as the image below.
-
+
-
- Fig. 7: Application Displayed on Smartphone
+
+
+ Fig. 7: Application Displayed on Smartphone
+
### Plug Your Nano
+
Connect your Ledger Nano to your android device, unlock it and open the ethereum application.
The steps are described below.
-
+
-
- Fig. 8: Nano Enter Code Pin
+
+
+ Fig. 8: Nano Enter Code Pin
+
-
- Fig. 10: Nano Run Application
+
+
+ Fig. 10: Nano Run Application
+
-
Now that the two devices are connected, the address will be displayed as shown below:
-
+
-
- Fig. 11: Address Account Displayed on Smartphone
+
+
+ Fig. 11: Address Account Displayed on Smartphone
+
-Congratulations you have successfully built your first Android HID application connected to your Ledger!
\ No newline at end of file
+Congratulations you have successfully built your first Android HID application connected to your Ledger!
diff --git a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-android.mdx b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-android.mdx
index 4efc528ed..35e68ff63 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-android.mdx
+++ b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-android.mdx
@@ -3,16 +3,15 @@ title: React Native Bluetooth on Android (Nano X only)
description: In this section you will see how to create a React Native application using the @ledgerhq/react-native-hw-transport-ble.
---
-import { Callout } from 'nextra/components'
-import Zoom from 'react-medium-image-zoom'
-import 'react-medium-image-zoom/dist/styles.css'
-import Image from 'next/image'
-
-
+import { Callout } from "nextra/components";
+import Zoom from "react-medium-image-zoom";
+import "react-medium-image-zoom/dist/styles.css";
+import Image from "next/image";
# React Native Bluetooth on Android (Nano X only)
## Introduction
+
In this section you will see how to create a React Native application using the [@ledgerhq/react-native-hw-transport-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/react-native-hw-transport-ble).
For this project some general prerequisites are mandatory and you can find them [here](../../getting-started#prerequisites).
@@ -20,13 +19,15 @@ Then you can now go through the prerequisite for Android development below.
## One-time setup
-### Environnement
+### Environnement
+
+Make sure you go through:
-Make sure you go through:
1. the [Development Prerequisites](../../getting-started#prerequisites).
1. the [Mobile Environment Setup](./environment-setup).
### Environnement variables
+
If you are using bash, put the environment variable into the bash_profile as below:
```console copy
@@ -94,10 +95,10 @@ Then import the "polyfill.js" in "index.js" as shown below:
* @format
*/
-import "./polyfill"; //import this
-import {AppRegistry} from 'react-native';
-import App from './src/App'; //modify this import
-import {name as appName} from './app.json';
+import "./polyfill"; //import this
+import { AppRegistry } from "react-native";
+import App from "./src/App"; //modify this import
+import { name as appName } from "./app.json";
AppRegistry.registerComponent(appName, () => App);
```
@@ -118,10 +119,10 @@ import TransportBLE from "@ledgerhq/react-native-hw-transport-ble";
class App extends Component {
state = {
- transport: null
+ transport: null,
};
- onSelectDevice = async device => {
+ onSelectDevice = async (device) => {
const transport = await TransportBLE.open(device);
transport.on("disconnect", () => {
// Intentionally for the sake of simplicity we use a transport local state
@@ -152,12 +153,12 @@ import {
Text,
TouchableOpacity,
StyleSheet,
- ActivityIndicator
+ ActivityIndicator,
} from "react-native";
class DeviceItem extends Component {
state = {
- pending: false
+ pending: false,
};
onPress = async () => {
this.setState({ pending: true });
@@ -195,12 +196,12 @@ const styles = StyleSheet.create({
borderWidth: 1,
flexDirection: "row",
alignItems: "center",
- justifyContent: "space-between"
+ justifyContent: "space-between",
},
deviceName: {
fontSize: 20,
- fontWeight: "bold"
- }
+ fontWeight: "bold",
+ },
});
```
@@ -372,12 +373,12 @@ import AppEth from "@ledgerhq/hw-app-eth";
import TransportBLE from "@ledgerhq/react-native-hw-transport-ble";
import QRCode from "react-native-qrcode-svg";
-const delay = ms => new Promise(success => setTimeout(success, ms));
+const delay = (ms) => new Promise((success) => setTimeout(success, ms));
class ShowAddressScreen extends Component {
state = {
error: null,
- address: null
+ address: null,
};
async componentDidMount() {
@@ -393,7 +394,7 @@ class ShowAddressScreen extends Component {
this.unmounted = true;
}
- fetchAddress = async verify => {
+ fetchAddress = async (verify) => {
const { transport } = this.props;
try {
const eth = new AppEth(transport);
@@ -444,38 +445,39 @@ const styles = StyleSheet.create({
flex: 1,
padding: 16,
alignItems: "center",
- justifyContent: "center"
+ justifyContent: "center",
},
error: {
color: "#c00",
- fontSize: 16
+ fontSize: 16,
},
loading: {
color: "#999",
- fontSize: 16
+ fontSize: 16,
},
title: {
fontSize: 22,
- marginBottom: 16
+ marginBottom: 16,
},
address: {
marginTop: 16,
color: "#555",
- fontSize: 14
- }
+ fontSize: 14,
+ },
});
```
-The folder will contain these files:
+The folder will contain these files:

-*Fig. 4: Folder of the Application*
+_Fig. 4: Folder of the Application_
### Dependencies
#### Installation
Run:
+
```console copy
npm install --save react-native-qrcode-svg
npm install --save react-native-svg
@@ -486,18 +488,19 @@ npx react-native link react-native-ble-plx
npm install --save buffer
npm install --save @ledgerhq/hw-app-eth
```
-| Package | What it does |
-|---------|------------------|
-| [react-native-qrcode-svg](https://www.npmjs.com/package/react-native-qrcode-svg) | It allows you to create a QR code. |
-|[react-native-svg](https://www.npmjs.com/package/react-native-svg) | It is a mandatory package to use **react-native-qrcode-svg** |
-|[rxjs](https://www.npmjs.com/package/rxjs) | It is a rewrite of "Reactive-Extensions/RxJS" and is the latest production-ready version of RxJS. |
-|[@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
-| [react-native-ble-plx](https://www.npmjs.com/package/react-native-ble-plx) | It scans the bluetooth devices. |
-|[buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
-| [hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It helps you ask your Ledger device to access the ethereum address. |
+| Package | What it does |
+| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
+| [react-native-qrcode-svg](https://www.npmjs.com/package/react-native-qrcode-svg) | It allows you to create a QR code. |
+| [react-native-svg](https://www.npmjs.com/package/react-native-svg) | It is a mandatory package to use **react-native-qrcode-svg** |
+| [rxjs](https://www.npmjs.com/package/rxjs) | It is a rewrite of "Reactive-Extensions/RxJS" and is the latest production-ready version of RxJS. |
+| [@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
+| [react-native-ble-plx](https://www.npmjs.com/package/react-native-ble-plx) | It scans the bluetooth devices. |
+| [buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
+| [hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It helps you ask your Ledger device to access the ethereum address. |
#### package.json
+
Now that the dependencies are installed you can find them in the “package.js”.
This is how your “package.json” has to look like.
@@ -540,12 +543,13 @@ This is how your “package.json” has to look like.
}
```
+
#### Build.gradle Modification
In “build.gradle”, in the "android" folder change `minSdkVersion = 21` to `minSdkVersion = 24`.

-*Fig. 5: Build.gradle Modify the minSdkVersion*
+_Fig. 5: Build.gradle Modify the minSdkVersion_
You can now test the application you have built.
@@ -553,221 +557,305 @@ You can now test the application you have built.
App testing is done on your smartphone because the Android Studio emulator cannot use Bluetooth or USB connexions.
-
Please refer to the information for [Android Emulator Limitation](https://stackoverflow.com/questions/22604305/how-to-use-android-emulator-for-testing-bluetooth-application).
### Enable Developer Settings
+
To integrate an application on your Android smartphone you have to enable the developer role.
-To do that go to Settings > About Phone > Build Number, and tap 7 times on build number to enable the developer settings.
+To do that go to Settings > About Phone > Build Number, and tap 7 times on build number to enable the developer settings.
-Then go to Settings > System > Advanced > Developer Options and enable the "USB debugging" as well as "Install via USB"
+Then go to Settings > System > Advanced > Developer Options and enable the "USB debugging" as well as "Install via USB"
Connect your phone to your computer, and run the command below to check your device is connected:
+
```console copy
adb devices
```
+
If all goes well, the list of devices is displayed as shown below:
-
+
-
- Fig. 6: Device Connected On The Machine
+
+
+ Fig. 6: Device Connected On The Machine
+
- For more information about enabling the developer settings on your android device go to [android studio docs](https://developer.android.com/studio/debug/dev-options).
+ For more information about enabling the developer settings on your android
+ device go to [android studio
+ docs](https://developer.android.com/studio/debug/dev-options).
### Start the Development Server
+
You can now open a terminal, go to the "myAndroidBTApp" folder, and start the server by running:
+
```console copy
npm start
```
+
### Install the App on Device
+
Keep the terminal where "metro" is running open and open a new terminal.
In this new terminal go to your app folder:
+
```console copy
cd myAndroidBTApp
```
-Run the command below to install the application on your android device. It assumes your smartphone is connected and your device is recognized by the command `adb devices` as mentioned in the [Previous Step](#enable-developer-settings).
+Run the command below to install the application on your android device. It assumes your smartphone is connected and your device is recognized by the command `adb devices` as mentioned in the [Previous Step](#enable-developer-settings).
+
```console copy
npm run android
```
A window will pop up on your android device to install the application. Click on "Yes" to install it and run it.
-
+
-
+
- Fig. 7: Mobile Application Installation
+
+ Fig. 7: Mobile Application Installation
+
### Launching the App
+
When launching the application it will be displayed as the image below. You must have the Bluetooth and location activated.
-
+
-
+
- Fig. 8: Application Displayed on Smartphone
+
+ Fig. 8: Application Displayed on Smartphone
+
If this is not what you see, you may get:
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
- Fig. 9: Authorize the Bluetooth
+
+ Fig. 9: Authorize the Bluetooth
+
- For more information about enabling the Bluetooth settings on your android device go to the troubleshooting tab.
+ For more information about enabling the Bluetooth settings on your android
+ device go to the troubleshooting tab.
-
### Pairing the Ledger Nano X
+
To pair your Ledger Nano X, unlock it.
-
+
-
+
- Fig. 14: Nano Run Application
+
+ Fig. 14: Nano Run Application
+
Now that the pairing is complete, the Nano X is ready with the ethereum application.
If all goes well you see the address of your ethereum account displayed.
-
+
-
+
- Fig. 15: Address Account Displayed on Smartphone
+
+ Fig. 15: Address Account Displayed on Smartphone
+
### Verify the Address
+
For security purposes, we display on your Nano X the same ethereum address for you to confirm.
-
+
-
-Congratulations you have successfully built your first Android Bluetooth application connected to your Ledger!
\ No newline at end of file
+Congratulations you have successfully built your first Android Bluetooth application connected to your Ledger!
diff --git a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-ios.mdx b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-ios.mdx
index 6018f273d..7e315e2f5 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-ios.mdx
+++ b/apps/docs/pages/docs/ledgerjs/integration/mobile-application/react-native-bluetooth-ios.mdx
@@ -1,17 +1,17 @@
---
-title: React Native Bluetooth on iOS (Nano X only)
+title: React Native Bluetooth on iOS (Nano X only)
description: In this section, you will see how to create a React Native application using the @ledgerhq/react-native-hw-transport-ble.
---
-import { Callout } from 'nextra/components'
-import Zoom from 'react-medium-image-zoom'
-import 'react-medium-image-zoom/dist/styles.css'
-import Image from 'next/image'
-
+import { Callout } from "nextra/components";
+import Zoom from "react-medium-image-zoom";
+import "react-medium-image-zoom/dist/styles.css";
+import Image from "next/image";
# React Native Bluetooth on iOS (Nano X only)
## Introduction
+
In this section, you will see how to create a React Native application using the [@ledgerhq/react-native-hw-transport-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble).
For this project some general prerequisites are mandatory and you can find them [here](../../getting-started#prerequisites).
@@ -21,15 +21,18 @@ Then you can now go through the prerequisite for iOS development below.
### Environnement
-Make sure you go through:
+Make sure you go through:
+
1. the [Development Prerequisites](../../getting-started#prerequisites).
1. the [Mobile Environment Setup](./environment-setup).
## App Coding
+
Now that we have set up the prerequisites, you can now create the application.
In this integration, we will use the ethereum application.
### App setup
+
First, open a terminal and create a new project. For this tutorial the project will be named “myiOSBTApp”.
Run:
@@ -46,6 +49,7 @@ cd myiOSBTApp
### Files
Run:
+
```console copy
mkdir src
touch polyfill.js
@@ -71,10 +75,10 @@ Then import the polyfill in "index.js" as shown below:
* @format
*/
-import "./polyfill"; //import this
-import {AppRegistry} from 'react-native';
-import App from './src/App'; //modify this import
-import {name as appName} from './app.json';
+import "./polyfill"; //import this
+import { AppRegistry } from "react-native";
+import App from "./src/App"; //modify this import
+import { name as appName } from "./app.json";
AppRegistry.registerComponent(appName, () => App);
```
@@ -95,10 +99,10 @@ import TransportBLE from "@ledgerhq/react-native-hw-transport-ble";
class App extends Component {
state = {
- transport: null
+ transport: null,
};
- onSelectDevice = async device => {
+ onSelectDevice = async (device) => {
const transport = await TransportBLE.open(device);
transport.on("disconnect", () => {
// Intentionally for the sake of simplicity we use a transport local state
@@ -129,12 +133,12 @@ import {
Text,
TouchableOpacity,
StyleSheet,
- ActivityIndicator
+ ActivityIndicator,
} from "react-native";
class DeviceItem extends Component {
state = {
- pending: false
+ pending: false,
};
onPress = async () => {
this.setState({ pending: true });
@@ -172,12 +176,12 @@ const styles = StyleSheet.create({
borderWidth: 1,
flexDirection: "row",
alignItems: "center",
- justifyContent: "space-between"
+ justifyContent: "space-between",
},
deviceName: {
fontSize: 20,
- fontWeight: "bold"
- }
+ fontWeight: "bold",
+ },
});
```
@@ -349,12 +353,12 @@ import AppEth from "@ledgerhq/hw-app-eth";
import TransportBLE from "@ledgerhq/react-native-hw-transport-ble";
import QRCode from "react-native-qrcode-svg";
-const delay = ms => new Promise(success => setTimeout(success, ms));
+const delay = (ms) => new Promise((success) => setTimeout(success, ms));
class ShowAddressScreen extends Component {
state = {
error: null,
- address: null
+ address: null,
};
async componentDidMount() {
@@ -370,7 +374,7 @@ class ShowAddressScreen extends Component {
this.unmounted = true;
}
- fetchAddress = async verify => {
+ fetchAddress = async (verify) => {
const { transport } = this.props;
try {
const eth = new AppEth(transport);
@@ -421,38 +425,39 @@ const styles = StyleSheet.create({
flex: 1,
padding: 16,
alignItems: "center",
- justifyContent: "center"
+ justifyContent: "center",
},
error: {
color: "#c00",
- fontSize: 16
+ fontSize: 16,
},
loading: {
color: "#999",
- fontSize: 16
+ fontSize: 16,
},
title: {
fontSize: 22,
- marginBottom: 16
+ marginBottom: 16,
},
address: {
marginTop: 16,
color: "#555",
- fontSize: 14
- }
+ fontSize: 14,
+ },
});
```
Your folder will look like this.

-*Fig. 3: Folder of the Application*
+_Fig. 3: Folder of the Application_
### Dependencies
#### Installation
Run:
+
```console copy
npm install --save react-native-qrcode-svg
npm install --save react-native-svg
@@ -464,18 +469,18 @@ npm install --save buffer
npm install --save @ledgerhq/hw-app-eth
```
-| Package | What it does |
-|---------|------------------|
-| [react-native-qrcode-svg](https://www.npmjs.com/package/react-native-qrcode-svg) | It allows you to create a QR code. |
-|[react-native-svg](https://www.npmjs.com/package/react-native-svg) | It is a mandatory package to use **react-native-qrcode-svg** |
-|[rxjs](https://www.npmjs.com/package/rxjs) | It is a rewrite of "Reactive-Extensions/RxJS" and is the latest production-ready version of RxJS. |
-|[@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
-| [react-native-ble-plx](https://www.npmjs.com/package/react-native-ble-plx) | It scans the bluetooth devices. |
-|[buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
-| [hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It helps you ask your Ledger device to access the ethereum address. |
-
+| Package | What it does |
+| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
+| [react-native-qrcode-svg](https://www.npmjs.com/package/react-native-qrcode-svg) | It allows you to create a QR code. |
+| [react-native-svg](https://www.npmjs.com/package/react-native-svg) | It is a mandatory package to use **react-native-qrcode-svg** |
+| [rxjs](https://www.npmjs.com/package/rxjs) | It is a rewrite of "Reactive-Extensions/RxJS" and is the latest production-ready version of RxJS. |
+| [@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
+| [react-native-ble-plx](https://www.npmjs.com/package/react-native-ble-plx) | It scans the bluetooth devices. |
+| [buffer](https://www.npmjs.com/package/buffer) | The goal is to provide an API that is 100% identical to node's Buffer API. |
+| [hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It helps you ask your Ledger device to access the ethereum address. |
#### package.json
+
Now that the dependencies are installed you can find them in the “package.js”.
This is how your “package.json” has to look like.
@@ -522,6 +527,7 @@ This is how your “package.json” has to look like.
#### Pod Installation
Then the pod has to be installed in the "ios" folder:
+
```console copy
cd ios/
pod install
@@ -529,16 +535,17 @@ pod update
```
#### Enable Bluetooth
+
Launch Xcode and open the ios folder in the "myiOSBTApp" folder to add the "NSBluetoothAlwaysUsageDescription" key to the "info.plist".

-*Fig. 4: Open a Project on Xcode*
+_Fig. 4: Open a Project on Xcode_

-*Fig. 5: Choose the Project*
+_Fig. 5: Choose the Project_

-*Fig. 6: Add NSBluetoothAlwaysUsageDescription in info.plist*
+_Fig. 6: Add NSBluetoothAlwaysUsageDescription in info.plist_
You can now test the application you have built.
@@ -546,206 +553,279 @@ You can now test the application you have built.
App testing is done on your smartphone because the Xcode emulator cannot use Bluetooth or USB connexions.
-
- Please refer to the information for [iOS Emulator limitation](https://developer.apple.com/forums/thread/14983).
+ Please refer to the information for [iOS Emulator
+ limitation](https://developer.apple.com/forums/thread/14983).
### Build the App
+
To build your application on your Apple device you have to connect Xcode to an Apple account as shown below.

-*Fig. 7: Connect Xcode to an Apple Account*
+_Fig. 7: Connect Xcode to an Apple Account_
Then connect your Apple device to your computer to build the application directly on the Apple device.
If all goes well the device name will be displayed on the top of the Xcode window, all you have to do is click on the triangle icon on the top left corner to build the app on your Apple device.

-*Fig. 8: Build the Application*
+_Fig. 8: Build the Application_
### Trusting the Apple Development
+
To accept the installation of the application.
You have to trust the "Apple development" on your device. Follow the steps below.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
- Fig. 9: Trusting the Apple Development
+
+ Fig. 9: Trusting the Apple Development
+
You can finally test the application by launching it.
### Launching the Application
+
When launching the application it will be displayed as shown below. You must have the Bluetooth and location activated.
-
+
-
+
-
+
-
+
-
+
-
+
- Fig. 10: Launching the Application
+
+ Fig. 10: Launching the Application
+
### Pairing the Ledger Nano X
+
To pair your Ledger Nano X you must unlock it.
-
+
-
+
- Fig. 15: Nano Run Application
+
+ Fig. 15: Nano Run Application
+
Now that the pairing is done, the Nano X is ready with the ethereum application.
If all goes well you must see the address of your ethereum account displayed.
-
-
+
-
+
- Fig. 16: Address Account Displayed on Smartphone
+
+ Fig. 16: Address Account Displayed on Smartphone
+
### Verify the Address
-For security purposes, we display on your Nano X the same ethereum address for you to confirm.
+For security purposes, we display on your Nano X the same ethereum address for you to confirm.
-
+
-Congratulations you have successfully built your first iOS Bluetooth application connected to your Ledger!
\ No newline at end of file
+Congratulations you have successfully built your first iOS Bluetooth application connected to your Ledger!
diff --git a/apps/docs/pages/docs/ledgerjs/integration/web-application/web-bluetooth.mdx b/apps/docs/pages/docs/ledgerjs/integration/web-application/web-bluetooth.mdx
index 16b1d3ce1..690e559c5 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/web-application/web-bluetooth.mdx
+++ b/apps/docs/pages/docs/ledgerjs/integration/web-application/web-bluetooth.mdx
@@ -3,22 +3,23 @@ title: Web Bluetooth
description: In this section, we will guide you through the creation of an application. This application will connect to your Ledger Nano X to display the address of your account (eg. bitcoin account, ethereum account).
---
-import { Callout } from 'nextra/components'
-import Image from 'next/image'
-
+import { Callout } from "nextra/components";
+import Image from "next/image";
# Web Bluetooth
## Introduction
+
In this section, we will guide you through the creation of an application.
-This application will connect to your Ledger Nano X to display the address of your account (eg. bitcoin account, ethereum account).
+This application will connect to your Ledger Nano X to display the address of your account (eg. bitcoin account, ethereum account).
**This walkthrough will only work with a Ledger Nano X**.
-The Ledger Nano S and S Plus do not have `Bluetooth` connection.
+The Ledger Nano S and S Plus do not have `Bluetooth` connection.
Please be aware that the Bluetooth implementation is only supported by a few browsers.
You can check if [your browser supports](https://caniuse.com/web-bluetooth) connections via Web Bluetooth.
+
## One-time setup
@@ -40,7 +41,9 @@ From your `Github folder` or favourite `examples folder`, run:
```console copy
npx create-next-app@latest examples-web-bluetooth
```
+
You will prompted a series of questions, answer as indicated below:
+
```console copy
Would you like to use TypeScript? No
Would you like to use ESLint? No
@@ -51,14 +54,15 @@ Would you like to customize the default import alias (@/*)? No
```
Navigate to your app’s directory:
+
```console copy
cd examples-web-bluetooth
```
-Open the folder in an editor. The folder will contain these files:
+Open the folder in an editor. The folder will contain these files:

-*Fig. 1: Folder of the Application*
+_Fig. 1: Folder of the Application_
### Files
@@ -77,6 +81,7 @@ export default function Home() {
);
}
```
+
#### \_app.js
In pages/\_app.js replace the existing coe with the following:
@@ -86,15 +91,14 @@ import React, { Component } from "react";
import eip55 from "eip55";
import BluetoothTransport from "@ledgerhq/hw-transport-web-ble";
import AppEth from "@ledgerhq/hw-app-eth";
-import styles from '../styles/Home.module.css';
+import styles from "../styles/Home.module.css";
import QRCode from "qrcode";
-
-const delay = ms => new Promise(success => setTimeout(success, ms));
+const delay = (ms) => new Promise((success) => setTimeout(success, ms));
class DeviceSelectionScreen extends Component {
state = {
- devices: []
+ devices: [],
};
createBLE = async () => {
@@ -117,7 +121,7 @@ class DeviceSelectionScreen extends Component {
class ShowAddressScreen extends Component {
state = {
error: null,
- address: null
+ address: null,
};
async componentDidMount() {
@@ -134,7 +138,7 @@ class ShowAddressScreen extends Component {
this.unmounted = true;
}
- fetchAddress = async verify => {
+ fetchAddress = async (verify) => {
const { transport } = this.props;
try {
const eth = new AppEth(transport);
@@ -154,14 +158,13 @@ class ShowAddressScreen extends Component {
async generateQRCode() {
try {
- const response = await QRCode.toCanvas(this.state.address)
- document.getElementById("qrcode").appendChild(response)
+ const response = await QRCode.toCanvas(this.state.address);
+ document.getElementById("qrcode").appendChild(response);
} catch (error) {
- console.log(error)
+ console.log(error);
}
}
-
render() {
const { address, error } = this.state;
@@ -192,10 +195,10 @@ class ShowAddressScreen extends Component {
class App extends Component {
state = {
- transport: null
+ transport: null,
};
- onSelectDevice = transport => {
+ onSelectDevice = (transport) => {
window.ledgerTransport = transport;
transport.on("disconnect", () => {
this.setState({ transport: null });
@@ -220,7 +223,6 @@ class App extends Component {
export default App;
```
-
#### Home.module.css
In Styles/Home.module.css replace the existing code with the following:
@@ -233,9 +235,9 @@ In Styles/Home.module.css replace the existing code with the following:
flex-direction: column;
justify-content: center;
align-items: center;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
- "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
- sans-serif;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
+ "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
+ "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@@ -273,7 +275,7 @@ In Styles/Home.module.css replace the existing code with the following:
#### Modify next.config.js
- Remove `reactStrictMode: true,`
+Remove `reactStrictMode: true,`
```
/** @type {import('next').NextConfig} */
@@ -282,7 +284,6 @@ const nextConfig = {}
module.exports = nextConfig
```
-
### Dependencies
#### Installation
@@ -295,13 +296,13 @@ npm install --save @ledgerhq/hw-transport-web-ble
npm install --save eip55
```
-| Package | What does it do? |
-|---------|------------------|
-|[@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It will help you ask your Nano to access the ethereum address. |
-|[@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
-|[eip55](https://www.npmjs.com/package/eip55) | An EIP55 compatible address encoding library.|
+| Package | What does it do? |
+| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
+| [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-eth) | It will help you ask your Nano to access the ethereum address. |
+| [@ledgerhq/hw-transport-web-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-web-ble) | It provides you with all the methods to interact with your Ledger Nano X with a Bluetooth connexion. |
+| [eip55](https://www.npmjs.com/package/eip55) | An EIP55 compatible address encoding library. |
-#### Package.json
+#### Package.json
Now that the dependencies are installed you can find them in the “package.js”.
@@ -309,6 +310,7 @@ Now that the dependencies are installed you can find them in the “package.js
1. Check Contents
##### Modify Scripts
+
```javascript copy
"scripts": {
"dev": "next dev",
@@ -317,7 +319,7 @@ Now that the dependencies are installed you can find them in the “package.js
},
```
-##### Check your “package.json” looks like this:
+##### Check your “package.json” looks like this:
```javascript copy
{
@@ -340,17 +342,16 @@ Now that the dependencies are installed you can find them in the “package.js
}
}
```
+
## App Launch
### Enable Bluetooth
-Make sure the Bluetooth feature of your Nano is enabled. To check, see [here](https://support.ledger.com/hc/en-us/articles/360019115193-Access-Control-Center?docs=true).
+Make sure the Bluetooth feature of your Nano is enabled. To check, see [here](https://support.ledger.com/hc/en-us/articles/360019115193-Access-Control-Center?docs=true).
- If it was not enabled, you need to:
- 1. enable it
- 2. power OFF your Nano
- 3. and power it back ON.
+ If it was not enabled, you need to: 1. enable it 2. power OFF your Nano 3. and
+ power it back ON.
### Start de Development Server
@@ -363,82 +364,104 @@ npm run dev
```
- Not all browsers support Bluetooth.
+ Not all browsers support Bluetooth.
Please look at the [browser support page](https://caniuse.com/web-bluetooth).
Now the application is up and running. Open the browser and go to `localhost:3000`, it will display :

-*Fig. 2: Application Running on Browser*
+_Fig. 2: Application Running on Browser_
### Launch Ethereum App
+
Before clicking on the button, unlock it and run the Ethereum application.
The steps are described below.
-
+
-
- Fig. 4: Nano Enter Code Pin
+
+
+ Fig. 4: Nano Enter Code Pin
+
-
- Fig. 6: The App is running
+
+
+ Fig. 6: The App is running
+
### Connect Your Nano to the Application
+
Now you can click on the button and a popup will be prompt. Choose your Ledger Nano X and click connexion

-*Fig. 7: Connect the Nano with Bluetooth*
+_Fig. 7: Connect the Nano with Bluetooth_
Then another popup will be prompt to ask you to confirm the pairing

-*Fig. 8: Request of Pairing*
+_Fig. 8: Request of Pairing_
Finally, if all goes well the address must be displayed with the QR code

-*Fig. 9: Address Account Displayed*
+_Fig. 9: Address Account Displayed_
### Verify the Address on Nano
For security reasons, the address will also be displayed on your Ledger Nano X to verify and confirm the address.
-
+
-
-Congratulations you have successfully built your first application connected to your Ledger Nano X!
\ No newline at end of file
+Congratulations you have successfully built your first application connected to your Ledger Nano X!
diff --git a/apps/docs/pages/docs/ledgerjs/integration/web-application/web-hid-usb.mdx b/apps/docs/pages/docs/ledgerjs/integration/web-application/web-hid-usb.mdx
index 39da2f121..7ea5e5b94 100644
--- a/apps/docs/pages/docs/ledgerjs/integration/web-application/web-hid-usb.mdx
+++ b/apps/docs/pages/docs/ledgerjs/integration/web-application/web-hid-usb.mdx
@@ -3,18 +3,19 @@ title: Web USB/HID
description: In this section, we will guide you through the creation of a web application. This application will connect to your Nano to display the address of a Bitcoin account. If you want it for Ethereum you can easily modify it.
---
-import Image from 'next/image'
-import { Callout } from 'nextra/components'
+import Image from "next/image";
+import { Callout } from "nextra/components";
# Web USB/HID
## Introduction
+
In this section, we will guide you through the creation of a web application.
The instructions for Web USB and Web HID are very similar, with only a few lines to comment out, so this is a combined walkthrough.
-This application will connect to your Nano to display the address of a Bitcoin account.
+This application will connect to your Nano to display the address of a Bitcoin account.
You can easily modify the code, if you want it for Ethereum.
-Reference note: the packages referenced here are
+Reference note: the packages referenced here are
Web USB: [@ledgerhq/hw-transport-webusb](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webusb)
Web HID: [@ledgerhq/hw-transport-webhid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webhid).
@@ -51,45 +52,43 @@ touch src/index.html
touch src/main.js
```
-The folder will contain these files:
+The folder will contain these files:

-*Fig. 1: File structure*
+_Fig. 1: File structure_
### Files
+
Open the folder example-web-hid-usb in an code editor.
#### index.html
-In index.html copy-paste the following code :
+In index.html copy-paste the following code :
```html copy
-
+
My First Embedded App
-
-
-
+
```
-
#### main.js
In main.js copy-paste the following code:
- Comment out or remove the `import` package you don't need
- (`@ledgerhq/hw-transport-webusb` or `@ledgerhq/hw-transport-webhid`)
+ Comment out or remove the `import` package you don't need
+ (`@ledgerhq/hw-transport-webusb` or `@ledgerhq/hw-transport-webhid`)
and the `const transport` you don't use.
```javascript copy
-import 'core-js/actual';
+import "core-js/actual";
import { listen } from "@ledgerhq/logs";
import AppBtc from "@ledgerhq/hw-app-btc";
@@ -99,14 +98,14 @@ import TransportWebUSB from "@ledgerhq/hw-transport-webusb";
import TransportWebHID from "@ledgerhq/hw-transport-webhid";
//Display the header in the div which has the ID "main"
-const initial = "
Connect your Nano and open the Bitcoin app. Click anywhere to start...
";
+const initial =
+ "
Connect your Nano and open the Bitcoin app. Click anywhere to start...
";
const $main = document.getElementById("main");
$main.innerHTML = initial;
document.body.addEventListener("click", async () => {
$main.innerHTML = initial;
try {
-
// Keep if you chose the USB protocol
const transport = await TransportWebUSB.create();
@@ -114,13 +113,13 @@ document.body.addEventListener("click", async () => {
const transport = await TransportWebHID.create();
//listen to the events which are sent by the Ledger packages in order to debug the app
- listen(log => console.log(log))
+ listen((log) => console.log(log));
//When the Ledger device connected it is trying to display the bitcoin address
const appBtc = new AppBtc({ transport, currency: "bitcoin" });
const { bitcoinAddress } = await appBtc.getWalletPublicKey(
"44'/0'/0'/0/0",
- { verify: false, format: "legacy"}
+ { verify: false, format: "legacy" },
);
//Display your bitcoin address on the screen
@@ -130,9 +129,11 @@ document.body.addEventListener("click", async () => {
$main.appendChild(h2);
//Display the address on the Ledger device and ask to verify the address
- await appBtc.getWalletPublicKey("44'/0'/0'/0/0", {format:"legacy", verify: true});
+ await appBtc.getWalletPublicKey("44'/0'/0'/0/0", {
+ format: "legacy",
+ verify: true,
+ });
} catch (e) {
-
//Catch any error thrown and displays it on the screen
const $err = document.createElement("code");
$err.style.color = "#f66";
@@ -141,7 +142,8 @@ document.body.addEventListener("click", async () => {
}
});
```
-### Dependencies
+
+### Dependencies
#### Installation
@@ -154,34 +156,35 @@ npm install --save-dev parcel
npm install --save @ledgerhq/hw-app-btc
```
-| Package | What does it do? |
-|---------|------------------|
-|[core-js](https://www.npmjs.com/package/core-js) | Modular standard library for JavaScript. |
-|[@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It provides you the log of all the errors from your connection with your Nano that may appear when developing. |
-|[parcel](https://parceljs.org/) | It is a build tool that will help you package your application to run it in the browser. |
-|[@ledgerhq/hw-app-btc](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-btc) | It will help you ask your Nano to access the Bitcoin address. |
+| Package | What does it do? |
+| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
+| [core-js](https://www.npmjs.com/package/core-js) | Modular standard library for JavaScript. |
+| [@ledgerhq/logs](https://www.npmjs.com/package/@ledgerhq/logs) | It provides you the log of all the errors from your connection with your Nano that may appear when developing. |
+| [parcel](https://parceljs.org/) | It is a build tool that will help you package your application to run it in the browser. |
+| [@ledgerhq/hw-app-btc](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-app-btc) | It will help you ask your Nano to access the Bitcoin address. |
#### Install the Transport HID or USB package
Then depending on your choice install one of the corresponding packages:
+
- Install the Ledger package [@ledgerhq/hw-transport-webhid](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webhid) which provide you with all the methods to interact with your Nano with an HID connection:
- ```console copy
- npm install --save @ledgerhq/hw-transport-webhid
- ```
+ ```console copy
+ npm install --save @ledgerhq/hw-transport-webhid
+ ```
- Install the Ledger package [@ledgerhq/hw-transport-webusb](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/hw-transport-webusb) which provide you with all the methods to interact with your Nano with a USB connection:
- ```console copy
- npm install --save @ledgerhq/hw-transport-webusb
- ```
-
+ ```console copy
+ npm install --save @ledgerhq/hw-transport-webusb
+ ```
#### Package.json
Modify `"main": "index.js"` to `"source": "src/index.html"`.
And ensure you have this line in your package.json:
+
```javascript copy
"scripts": {
- "build": "parcel build",
+ "build": "parcel build",
"start": "parcel"
},
```
@@ -197,8 +200,9 @@ Add this at the end of the script:
Your "package.json" should look like this:
- In the `dependencies` section of package.json, comment out or remove the line you don't need
- (`@ledgerhq/hw-transport-webusb` or `@ledgerhq/hw-transport-webhid`)
+ In the `dependencies` section of package.json, comment out or remove the line
+ you don't need
+ (`@ledgerhq/hw-transport-webusb` or `@ledgerhq/hw-transport-webhid`)
Do not copy-paste as is, without removing the other line.
@@ -247,7 +251,7 @@ npm run start
Now the application is up and running. Open the browser and go to `localhost:1234`, it will display :

-*Fig. 3: Application Running on Browser*
+_Fig. 3: Application Running on Browser_
Before clicking on the text connect your Nano to the USB port, unlock it and run the bitcoin application. The steps are described below.
@@ -255,22 +259,34 @@ Before clicking on the text connect your Nano to the USB port, unlock it and run
-
- Fig. 6: Embedded Run Application
+
+
+ Fig. 6: Embedded Run Application
+
@@ -279,7 +295,7 @@ Before clicking on the text connect your Nano to the USB port, unlock it and run
Now you can click on the text and a popup will be prompt. Choose your Nano and click connect:

-*Fig. 7: Connect your Nano*
+_Fig. 7: Connect your Nano_
### 5. Check displayed address
@@ -287,19 +303,20 @@ The App gets the Bitcoin address and displays it.
Check that the address displayed on the App is the same as the one displayed on the Ledger device.

-*Fig. 8: Address Account Displayed*
+_Fig. 8: Address Account Displayed_
Congratulations, you have successfully built your first application connected to a Nano!
- Note that if your finalize the operation on your Nano by accepting or rejecting, the corresponding message appears on your web application.
+ Note that if your finalize the operation on your Nano by accepting or
+ rejecting, the corresponding message appears on your web application.
## App Coding (Android Chrome)
Android chrome supports HID and USB.
For smartphones, only Android supports web applications.
-For Android, only Chrome supports web application.
+For Android, only Chrome supports web application.
### package.json
@@ -307,8 +324,9 @@ To test your application on android, a little change has to be made.
Add the `--https` flag in your `"start"` script
- In the `dependencies` section of package.json, comment out or remove the line you don't need
- (`@ledgerhq/hw-transport-webusb` or `@ledgerhq/hw-transport-webhid`)
+ In the `dependencies` section of package.json, comment out or remove the line
+ you don't need
+ (`@ledgerhq/hw-transport-webusb` or `@ledgerhq/hw-transport-webhid`)
Do not copy-paste as is, without removing the other line.
@@ -320,7 +338,7 @@ Add the `--https` flag in your `"start"` script
"source": "src/index.html",
"dependencies": {
"@ledgerhq/hw-app-btc": "^6.12.1",
- "@ledgerhq/hw-transport-webhid": "^6.11.2",
+ "@ledgerhq/hw-transport-webhid": "^6.11.2",
"@ledgerhq/hw-transport-webusb": "^6.11.2",
"@ledgerhq/logs": "^6.10.0",
"core-js": "^3.20.2"
@@ -330,7 +348,7 @@ Add the `--https` flag in your `"start"` script
},
"scripts": {
"build": "parcel build",
- "start": "parcel --https"
+ "start": "parcel --https"
},
"author": "",
"license": "ISC"
diff --git a/apps/docs/pages/docs/ledgerjs/references/identifiers.mdx b/apps/docs/pages/docs/ledgerjs/references/identifiers.mdx
index b1c9b0aba..7232090e5 100644
--- a/apps/docs/pages/docs/ledgerjs/references/identifiers.mdx
+++ b/apps/docs/pages/docs/ledgerjs/references/identifiers.mdx
@@ -4,4 +4,4 @@ title: Where can I find the devices USB identifiers?
# Where can I find the devices USB identifiers?
-The Devices USB identifiers can be found in the [ledger-live repository](https://github.com/LedgerHQ/ledger-live/blob/develop/libs/ledgerjs/packages/devices/src/index.ts).
\ No newline at end of file
+The Devices USB identifiers can be found in the [ledger-live repository](https://github.com/LedgerHQ/ledger-live/blob/develop/libs/ledgerjs/packages/devices/src/index.ts).
diff --git a/apps/docs/public/device-interaction/LC-flow.png b/apps/docs/public/device-interaction/LC-flow.png
new file mode 100644
index 000000000..10fd5e3a6
Binary files /dev/null and b/apps/docs/public/device-interaction/LC-flow.png differ
diff --git a/apps/docs/public/device-interaction/Xcode-build.png b/apps/docs/public/device-interaction/Xcode-build.png
new file mode 100644
index 000000000..74684c5e6
Binary files /dev/null and b/apps/docs/public/device-interaction/Xcode-build.png differ
diff --git a/apps/docs/public/device-interaction/Xcode-locations.png b/apps/docs/public/device-interaction/Xcode-locations.png
new file mode 100644
index 000000000..04179326b
Binary files /dev/null and b/apps/docs/public/device-interaction/Xcode-locations.png differ
diff --git a/apps/docs/public/device-interaction/Xcode-project.png b/apps/docs/public/device-interaction/Xcode-project.png
new file mode 100644
index 000000000..80d83aec5
Binary files /dev/null and b/apps/docs/public/device-interaction/Xcode-project.png differ
diff --git a/apps/docs/public/device-interaction/Xcode-settings.png b/apps/docs/public/device-interaction/Xcode-settings.png
new file mode 100644
index 000000000..1ab6bc1f7
Binary files /dev/null and b/apps/docs/public/device-interaction/Xcode-settings.png differ
diff --git a/apps/docs/public/device-interaction/Xcode-signing-capabilities.png b/apps/docs/public/device-interaction/Xcode-signing-capabilities.png
new file mode 100644
index 000000000..5094e47c7
Binary files /dev/null and b/apps/docs/public/device-interaction/Xcode-signing-capabilities.png differ
diff --git a/apps/docs/public/device-interaction/Xcode.png b/apps/docs/public/device-interaction/Xcode.png
new file mode 100644
index 000000000..f16a59f1c
Binary files /dev/null and b/apps/docs/public/device-interaction/Xcode.png differ
diff --git a/apps/docs/public/device-interaction/account-cosmos.png b/apps/docs/public/device-interaction/account-cosmos.png
new file mode 100644
index 000000000..9f476dc86
Binary files /dev/null and b/apps/docs/public/device-interaction/account-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/adb-devices.png b/apps/docs/public/device-interaction/adb-devices.png
new file mode 100644
index 000000000..0f882a8c7
Binary files /dev/null and b/apps/docs/public/device-interaction/adb-devices.png differ
diff --git a/apps/docs/public/device-interaction/address-cosmos.png b/apps/docs/public/device-interaction/address-cosmos.png
new file mode 100644
index 000000000..0b7c40cd5
Binary files /dev/null and b/apps/docs/public/device-interaction/address-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/amount-cosmos.png b/apps/docs/public/device-interaction/amount-cosmos.png
new file mode 100644
index 000000000..ed0fa4fe2
Binary files /dev/null and b/apps/docs/public/device-interaction/amount-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/android-ble-error.jpg b/apps/docs/public/device-interaction/android-ble-error.jpg
new file mode 100644
index 000000000..c26ff4508
Binary files /dev/null and b/apps/docs/public/device-interaction/android-ble-error.jpg differ
diff --git a/apps/docs/public/device-interaction/android-device-hid-address.jpg b/apps/docs/public/device-interaction/android-device-hid-address.jpg
new file mode 100644
index 000000000..15b5075ff
Binary files /dev/null and b/apps/docs/public/device-interaction/android-device-hid-address.jpg differ
diff --git a/apps/docs/public/device-interaction/android-device-hid.jpg b/apps/docs/public/device-interaction/android-device-hid.jpg
new file mode 100644
index 000000000..d438ca789
Binary files /dev/null and b/apps/docs/public/device-interaction/android-device-hid.jpg differ
diff --git a/apps/docs/public/device-interaction/android-rn-ble-address.jpg b/apps/docs/public/device-interaction/android-rn-ble-address.jpg
new file mode 100644
index 000000000..5262666b3
Binary files /dev/null and b/apps/docs/public/device-interaction/android-rn-ble-address.jpg differ
diff --git a/apps/docs/public/device-interaction/android-rn-ble-list.jpg b/apps/docs/public/device-interaction/android-rn-ble-list.jpg
new file mode 100644
index 000000000..2b4c3dde7
Binary files /dev/null and b/apps/docs/public/device-interaction/android-rn-ble-list.jpg differ
diff --git a/apps/docs/public/device-interaction/android-rn-ble.jpg b/apps/docs/public/device-interaction/android-rn-ble.jpg
new file mode 100644
index 000000000..554527741
Binary files /dev/null and b/apps/docs/public/device-interaction/android-rn-ble.jpg differ
diff --git a/apps/docs/public/device-interaction/android-rn-pairing.jpg b/apps/docs/public/device-interaction/android-rn-pairing.jpg
new file mode 100644
index 000000000..46990670b
Binary files /dev/null and b/apps/docs/public/device-interaction/android-rn-pairing.jpg differ
diff --git a/apps/docs/public/device-interaction/android-settings-1.jpg b/apps/docs/public/device-interaction/android-settings-1.jpg
new file mode 100644
index 000000000..bd48e37ee
Binary files /dev/null and b/apps/docs/public/device-interaction/android-settings-1.jpg differ
diff --git a/apps/docs/public/device-interaction/android-settings-2.jpg b/apps/docs/public/device-interaction/android-settings-2.jpg
new file mode 100644
index 000000000..393cfe577
Binary files /dev/null and b/apps/docs/public/device-interaction/android-settings-2.jpg differ
diff --git a/apps/docs/public/device-interaction/android-settings-3.jpg b/apps/docs/public/device-interaction/android-settings-3.jpg
new file mode 100644
index 000000000..d457e6a12
Binary files /dev/null and b/apps/docs/public/device-interaction/android-settings-3.jpg differ
diff --git a/apps/docs/public/device-interaction/android-studio-SDK.png b/apps/docs/public/device-interaction/android-studio-SDK.png
new file mode 100644
index 000000000..164a0bc99
Binary files /dev/null and b/apps/docs/public/device-interaction/android-studio-SDK.png differ
diff --git a/apps/docs/public/device-interaction/android-studio-settings.png b/apps/docs/public/device-interaction/android-studio-settings.png
new file mode 100644
index 000000000..370effbea
Binary files /dev/null and b/apps/docs/public/device-interaction/android-studio-settings.png differ
diff --git a/apps/docs/public/device-interaction/android-studio.png b/apps/docs/public/device-interaction/android-studio.png
new file mode 100644
index 000000000..701399cc8
Binary files /dev/null and b/apps/docs/public/device-interaction/android-studio.png differ
diff --git a/apps/docs/public/device-interaction/application-architecture.png b/apps/docs/public/device-interaction/application-architecture.png
new file mode 100644
index 000000000..a659baa93
Binary files /dev/null and b/apps/docs/public/device-interaction/application-architecture.png differ
diff --git a/apps/docs/public/device-interaction/application-sequence.png b/apps/docs/public/device-interaction/application-sequence.png
new file mode 100644
index 000000000..afb003e83
Binary files /dev/null and b/apps/docs/public/device-interaction/application-sequence.png differ
diff --git a/apps/docs/public/device-interaction/approve-cosmos.png b/apps/docs/public/device-interaction/approve-cosmos.png
new file mode 100644
index 000000000..e68828062
Binary files /dev/null and b/apps/docs/public/device-interaction/approve-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/bitcoinInstalled.png b/apps/docs/public/device-interaction/bitcoinInstalled.png
new file mode 100644
index 000000000..1921d5e80
Binary files /dev/null and b/apps/docs/public/device-interaction/bitcoinInstalled.png differ
diff --git a/apps/docs/public/device-interaction/button-curve.png b/apps/docs/public/device-interaction/button-curve.png
new file mode 100644
index 000000000..3fb5225e9
Binary files /dev/null and b/apps/docs/public/device-interaction/button-curve.png differ
diff --git a/apps/docs/public/device-interaction/button-opensea.png b/apps/docs/public/device-interaction/button-opensea.png
new file mode 100644
index 000000000..9e076662d
Binary files /dev/null and b/apps/docs/public/device-interaction/button-opensea.png differ
diff --git a/apps/docs/public/device-interaction/button-revoke.png b/apps/docs/public/device-interaction/button-revoke.png
new file mode 100644
index 000000000..ddf8c8181
Binary files /dev/null and b/apps/docs/public/device-interaction/button-revoke.png differ
diff --git a/apps/docs/public/device-interaction/button-zapper.png b/apps/docs/public/device-interaction/button-zapper.png
new file mode 100644
index 000000000..85acc8ace
Binary files /dev/null and b/apps/docs/public/device-interaction/button-zapper.png differ
diff --git a/apps/docs/public/device-interaction/chain-id-cosmos.png b/apps/docs/public/device-interaction/chain-id-cosmos.png
new file mode 100644
index 000000000..3765bb819
Binary files /dev/null and b/apps/docs/public/device-interaction/chain-id-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/change-minSDK.png b/apps/docs/public/device-interaction/change-minSDK.png
new file mode 100644
index 000000000..dcdbb16b2
Binary files /dev/null and b/apps/docs/public/device-interaction/change-minSDK.png differ
diff --git a/apps/docs/public/device-interaction/check-warning.png b/apps/docs/public/device-interaction/check-warning.png
new file mode 100644
index 000000000..ec8313406
Binary files /dev/null and b/apps/docs/public/device-interaction/check-warning.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-01.png b/apps/docs/public/device-interaction/cosmos-01.png
new file mode 100644
index 000000000..0407c2e7c
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-01.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-02.png b/apps/docs/public/device-interaction/cosmos-02.png
new file mode 100644
index 000000000..00e1be805
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-02.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-03.png b/apps/docs/public/device-interaction/cosmos-03.png
new file mode 100644
index 000000000..e15258d88
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-03.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-04.png b/apps/docs/public/device-interaction/cosmos-04.png
new file mode 100644
index 000000000..86275ed59
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-04.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-05.png b/apps/docs/public/device-interaction/cosmos-05.png
new file mode 100644
index 000000000..f190d4eb1
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-05.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-06.png b/apps/docs/public/device-interaction/cosmos-06.png
new file mode 100644
index 000000000..6fb754288
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-06.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-07.png b/apps/docs/public/device-interaction/cosmos-07.png
new file mode 100644
index 000000000..8d03ff7c9
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-07.png differ
diff --git a/apps/docs/public/device-interaction/cosmos-08.png b/apps/docs/public/device-interaction/cosmos-08.png
new file mode 100644
index 000000000..939e21c7e
Binary files /dev/null and b/apps/docs/public/device-interaction/cosmos-08.png differ
diff --git a/apps/docs/public/device-interaction/delegator-cosmos.png b/apps/docs/public/device-interaction/delegator-cosmos.png
new file mode 100644
index 000000000..3afd0c00f
Binary files /dev/null and b/apps/docs/public/device-interaction/delegator-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/electron-node-address.png b/apps/docs/public/device-interaction/electron-node-address.png
new file mode 100644
index 000000000..77ce15e53
Binary files /dev/null and b/apps/docs/public/device-interaction/electron-node-address.png differ
diff --git a/apps/docs/public/device-interaction/electron-node-hid-window.png b/apps/docs/public/device-interaction/electron-node-hid-window.png
new file mode 100644
index 000000000..9f32e6fad
Binary files /dev/null and b/apps/docs/public/device-interaction/electron-node-hid-window.png differ
diff --git a/apps/docs/public/device-interaction/ethereumInstallation.png b/apps/docs/public/device-interaction/ethereumInstallation.png
new file mode 100644
index 000000000..404128b20
Binary files /dev/null and b/apps/docs/public/device-interaction/ethereumInstallation.png differ
diff --git a/apps/docs/public/device-interaction/fee-cosmos.png b/apps/docs/public/device-interaction/fee-cosmos.png
new file mode 100644
index 000000000..ffacd2f16
Binary files /dev/null and b/apps/docs/public/device-interaction/fee-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/folder-e2e-eth.png b/apps/docs/public/device-interaction/folder-e2e-eth.png
new file mode 100644
index 000000000..30be0e382
Binary files /dev/null and b/apps/docs/public/device-interaction/folder-e2e-eth.png differ
diff --git a/apps/docs/public/device-interaction/folder-e2e-sol.png b/apps/docs/public/device-interaction/folder-e2e-sol.png
new file mode 100644
index 000000000..e5e858465
Binary files /dev/null and b/apps/docs/public/device-interaction/folder-e2e-sol.png differ
diff --git a/apps/docs/public/device-interaction/folder-rn-android.png b/apps/docs/public/device-interaction/folder-rn-android.png
new file mode 100644
index 000000000..5b4b83d25
Binary files /dev/null and b/apps/docs/public/device-interaction/folder-rn-android.png differ
diff --git a/apps/docs/public/device-interaction/folder-rn-ble.png b/apps/docs/public/device-interaction/folder-rn-ble.png
new file mode 100644
index 000000000..110c1df2e
Binary files /dev/null and b/apps/docs/public/device-interaction/folder-rn-ble.png differ
diff --git a/apps/docs/public/device-interaction/folderNodeHID.png b/apps/docs/public/device-interaction/folderNodeHID.png
new file mode 100644
index 000000000..4bdd99193
Binary files /dev/null and b/apps/docs/public/device-interaction/folderNodeHID.png differ
diff --git a/apps/docs/public/device-interaction/folderUsbHid.png b/apps/docs/public/device-interaction/folderUsbHid.png
new file mode 100644
index 000000000..e3a69c2d2
Binary files /dev/null and b/apps/docs/public/device-interaction/folderUsbHid.png differ
diff --git a/apps/docs/public/device-interaction/folderWebBle.png b/apps/docs/public/device-interaction/folderWebBle.png
new file mode 100644
index 000000000..2e00ebe68
Binary files /dev/null and b/apps/docs/public/device-interaction/folderWebBle.png differ
diff --git a/apps/docs/public/device-interaction/gas-cosmos.png b/apps/docs/public/device-interaction/gas-cosmos.png
new file mode 100644
index 000000000..1042c0624
Binary files /dev/null and b/apps/docs/public/device-interaction/gas-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/hash-message.png b/apps/docs/public/device-interaction/hash-message.png
new file mode 100644
index 000000000..d0b921efa
Binary files /dev/null and b/apps/docs/public/device-interaction/hash-message.png differ
diff --git a/apps/docs/public/device-interaction/infoplist.png b/apps/docs/public/device-interaction/infoplist.png
new file mode 100644
index 000000000..fd35d25f8
Binary files /dev/null and b/apps/docs/public/device-interaction/infoplist.png differ
diff --git a/apps/docs/public/device-interaction/iphone-rn-ble1.png b/apps/docs/public/device-interaction/iphone-rn-ble1.png
new file mode 100644
index 000000000..fd4c9adfb
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-rn-ble1.png differ
diff --git a/apps/docs/public/device-interaction/iphone-rn-ble2.png b/apps/docs/public/device-interaction/iphone-rn-ble2.png
new file mode 100644
index 000000000..01d6b4972
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-rn-ble2.png differ
diff --git a/apps/docs/public/device-interaction/iphone-rn-ble3.png b/apps/docs/public/device-interaction/iphone-rn-ble3.png
new file mode 100644
index 000000000..e9f1a87dd
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-rn-ble3.png differ
diff --git a/apps/docs/public/device-interaction/iphone-rn-ble4.png b/apps/docs/public/device-interaction/iphone-rn-ble4.png
new file mode 100644
index 000000000..ab04563e1
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-rn-ble4.png differ
diff --git a/apps/docs/public/device-interaction/iphone-rn-ble5.png b/apps/docs/public/device-interaction/iphone-rn-ble5.png
new file mode 100644
index 000000000..3225211e4
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-rn-ble5.png differ
diff --git a/apps/docs/public/device-interaction/iphone-rn-ble6.png b/apps/docs/public/device-interaction/iphone-rn-ble6.png
new file mode 100644
index 000000000..ce9ca47c0
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-rn-ble6.png differ
diff --git a/apps/docs/public/device-interaction/iphone-settings-1.png b/apps/docs/public/device-interaction/iphone-settings-1.png
new file mode 100644
index 000000000..43dd671f5
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-settings-1.png differ
diff --git a/apps/docs/public/device-interaction/iphone-settings-2.png b/apps/docs/public/device-interaction/iphone-settings-2.png
new file mode 100644
index 000000000..bc959e088
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-settings-2.png differ
diff --git a/apps/docs/public/device-interaction/iphone-settings-3.png b/apps/docs/public/device-interaction/iphone-settings-3.png
new file mode 100644
index 000000000..e78f16f41
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-settings-3.png differ
diff --git a/apps/docs/public/device-interaction/iphone-settings-4.png b/apps/docs/public/device-interaction/iphone-settings-4.png
new file mode 100644
index 000000000..aa33cbda4
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-settings-4.png differ
diff --git a/apps/docs/public/device-interaction/iphone-settings-5.png b/apps/docs/public/device-interaction/iphone-settings-5.png
new file mode 100644
index 000000000..98a66986b
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-settings-5.png differ
diff --git a/apps/docs/public/device-interaction/iphone-settings-6.png b/apps/docs/public/device-interaction/iphone-settings-6.png
new file mode 100644
index 000000000..805019779
Binary files /dev/null and b/apps/docs/public/device-interaction/iphone-settings-6.png differ
diff --git a/apps/docs/public/device-interaction/ledger-blind-signing.png b/apps/docs/public/device-interaction/ledger-blind-signing.png
new file mode 100644
index 000000000..5aa087601
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-blind-signing.png differ
diff --git a/apps/docs/public/device-interaction/ledger-horizontal.png b/apps/docs/public/device-interaction/ledger-horizontal.png
new file mode 100644
index 000000000..8dfe4885e
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-horizontal.png differ
diff --git a/apps/docs/public/device-interaction/ledger-horizontal.svg b/apps/docs/public/device-interaction/ledger-horizontal.svg
new file mode 100644
index 000000000..32b2408ed
--- /dev/null
+++ b/apps/docs/public/device-interaction/ledger-horizontal.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/docs/public/device-interaction/ledger-square.png b/apps/docs/public/device-interaction/ledger-square.png
new file mode 100644
index 000000000..7a4953603
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-square.png differ
diff --git a/apps/docs/public/device-interaction/ledger-square.svg b/apps/docs/public/device-interaction/ledger-square.svg
new file mode 100644
index 000000000..0313093f1
--- /dev/null
+++ b/apps/docs/public/device-interaction/ledger-square.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/docs/public/device-interaction/ledger-tx-accept.jpg b/apps/docs/public/device-interaction/ledger-tx-accept.jpg
new file mode 100644
index 000000000..9b6a633a0
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-tx-accept.jpg differ
diff --git a/apps/docs/public/device-interaction/ledger-tx-address.jpg b/apps/docs/public/device-interaction/ledger-tx-address.jpg
new file mode 100644
index 000000000..cd5835d87
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-tx-address.jpg differ
diff --git a/apps/docs/public/device-interaction/ledger-tx-amount.jpg b/apps/docs/public/device-interaction/ledger-tx-amount.jpg
new file mode 100644
index 000000000..ba19f8142
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-tx-amount.jpg differ
diff --git a/apps/docs/public/device-interaction/ledger-tx-fees.jpg b/apps/docs/public/device-interaction/ledger-tx-fees.jpg
new file mode 100644
index 000000000..c63e0524d
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-tx-fees.jpg differ
diff --git a/apps/docs/public/device-interaction/ledger-tx-network.png b/apps/docs/public/device-interaction/ledger-tx-network.png
new file mode 100644
index 000000000..63b58f18c
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-tx-network.png differ
diff --git a/apps/docs/public/device-interaction/ledger-tx-review.jpg b/apps/docs/public/device-interaction/ledger-tx-review.jpg
new file mode 100644
index 000000000..1d448f062
Binary files /dev/null and b/apps/docs/public/device-interaction/ledger-tx-review.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerAddress.jpg b/apps/docs/public/device-interaction/ledgerAddress.jpg
new file mode 100644
index 000000000..59846dc0c
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerAddress.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerAllow.jpg b/apps/docs/public/device-interaction/ledgerAllow.jpg
new file mode 100644
index 000000000..fda22bf55
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerAllow.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerApprove.jpg b/apps/docs/public/device-interaction/ledgerApprove.jpg
new file mode 100644
index 000000000..ae4090ad8
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerApprove.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerBtc.jpg b/apps/docs/public/device-interaction/ledgerBtc.jpg
new file mode 100644
index 000000000..ce01f3977
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerBtc.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerCodePin.jpg b/apps/docs/public/device-interaction/ledgerCodePin.jpg
new file mode 100644
index 000000000..9a3f46b51
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerCodePin.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerConnect.png b/apps/docs/public/device-interaction/ledgerConnect.png
new file mode 100644
index 000000000..4d4e8790f
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerConnect.png differ
diff --git a/apps/docs/public/device-interaction/ledgerEth.jpg b/apps/docs/public/device-interaction/ledgerEth.jpg
new file mode 100644
index 000000000..e73fa1c56
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerEth.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerPairing.jpg b/apps/docs/public/device-interaction/ledgerPairing.jpg
new file mode 100644
index 000000000..e3da27994
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerPairing.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerReady.jpg b/apps/docs/public/device-interaction/ledgerReady.jpg
new file mode 100644
index 000000000..daa91b8f7
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerReady.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerSol.jpg b/apps/docs/public/device-interaction/ledgerSol.jpg
new file mode 100644
index 000000000..840f1bcb3
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerSol.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerVerify.jpg b/apps/docs/public/device-interaction/ledgerVerify.jpg
new file mode 100644
index 000000000..9fb756085
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerVerify.jpg differ
diff --git a/apps/docs/public/device-interaction/ledgerlivetabs.png b/apps/docs/public/device-interaction/ledgerlivetabs.png
new file mode 100644
index 000000000..fd252765a
Binary files /dev/null and b/apps/docs/public/device-interaction/ledgerlivetabs.png differ
diff --git a/apps/docs/public/device-interaction/memo-cosmos.png b/apps/docs/public/device-interaction/memo-cosmos.png
new file mode 100644
index 000000000..aa5b509c8
Binary files /dev/null and b/apps/docs/public/device-interaction/memo-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/mobile-install-app.jpg b/apps/docs/public/device-interaction/mobile-install-app.jpg
new file mode 100644
index 000000000..310a87e9e
Binary files /dev/null and b/apps/docs/public/device-interaction/mobile-install-app.jpg differ
diff --git a/apps/docs/public/device-interaction/open_app_bitcoin.png b/apps/docs/public/device-interaction/open_app_bitcoin.png
new file mode 100644
index 000000000..df5947a74
Binary files /dev/null and b/apps/docs/public/device-interaction/open_app_bitcoin.png differ
diff --git a/apps/docs/public/device-interaction/overview.png b/apps/docs/public/device-interaction/overview.png
new file mode 100644
index 000000000..0ce469238
Binary files /dev/null and b/apps/docs/public/device-interaction/overview.png differ
diff --git a/apps/docs/public/device-interaction/please-review-cosmos.png b/apps/docs/public/device-interaction/please-review-cosmos.png
new file mode 100644
index 000000000..4341e66d6
Binary files /dev/null and b/apps/docs/public/device-interaction/please-review-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/reject-cosmos.png b/apps/docs/public/device-interaction/reject-cosmos.png
new file mode 100644
index 000000000..94e4eb355
Binary files /dev/null and b/apps/docs/public/device-interaction/reject-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/runkit-verification.png b/apps/docs/public/device-interaction/runkit-verification.png
new file mode 100644
index 000000000..4c9d098f5
Binary files /dev/null and b/apps/docs/public/device-interaction/runkit-verification.png differ
diff --git a/apps/docs/public/device-interaction/sequence-cosmos.png b/apps/docs/public/device-interaction/sequence-cosmos.png
new file mode 100644
index 000000000..773b2a918
Binary files /dev/null and b/apps/docs/public/device-interaction/sequence-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/sign-message-01.png b/apps/docs/public/device-interaction/sign-message-01.png
new file mode 100644
index 000000000..ba5f53c6a
Binary files /dev/null and b/apps/docs/public/device-interaction/sign-message-01.png differ
diff --git a/apps/docs/public/device-interaction/sign-message-02.png b/apps/docs/public/device-interaction/sign-message-02.png
new file mode 100644
index 000000000..fcb5da944
Binary files /dev/null and b/apps/docs/public/device-interaction/sign-message-02.png differ
diff --git a/apps/docs/public/device-interaction/sign-message-03.png b/apps/docs/public/device-interaction/sign-message-03.png
new file mode 100644
index 000000000..e6b215b9e
Binary files /dev/null and b/apps/docs/public/device-interaction/sign-message-03.png differ
diff --git a/apps/docs/public/device-interaction/sign-message-04.png b/apps/docs/public/device-interaction/sign-message-04.png
new file mode 100644
index 000000000..6160c967f
Binary files /dev/null and b/apps/docs/public/device-interaction/sign-message-04.png differ
diff --git a/apps/docs/public/device-interaction/solana-explorer-1.png b/apps/docs/public/device-interaction/solana-explorer-1.png
new file mode 100644
index 000000000..293b83d8c
Binary files /dev/null and b/apps/docs/public/device-interaction/solana-explorer-1.png differ
diff --git a/apps/docs/public/device-interaction/solana-explorer-2.png b/apps/docs/public/device-interaction/solana-explorer-2.png
new file mode 100644
index 000000000..0c2a9f057
Binary files /dev/null and b/apps/docs/public/device-interaction/solana-explorer-2.png differ
diff --git a/apps/docs/public/device-interaction/solana-faucet.png b/apps/docs/public/device-interaction/solana-faucet.png
new file mode 100644
index 000000000..53458f4e7
Binary files /dev/null and b/apps/docs/public/device-interaction/solana-faucet.png differ
diff --git a/apps/docs/public/device-interaction/step1account.png b/apps/docs/public/device-interaction/step1account.png
new file mode 100644
index 000000000..54be42cd6
Binary files /dev/null and b/apps/docs/public/device-interaction/step1account.png differ
diff --git a/apps/docs/public/device-interaction/step2account.png b/apps/docs/public/device-interaction/step2account.png
new file mode 100644
index 000000000..65026a1bb
Binary files /dev/null and b/apps/docs/public/device-interaction/step2account.png differ
diff --git a/apps/docs/public/device-interaction/step3account.png b/apps/docs/public/device-interaction/step3account.png
new file mode 100644
index 000000000..6c600bdc1
Binary files /dev/null and b/apps/docs/public/device-interaction/step3account.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-connect.png b/apps/docs/public/device-interaction/tutorial-1-connect.png
new file mode 100644
index 000000000..2930b162e
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-connect.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-etherscan.png b/apps/docs/public/device-interaction/tutorial-1-etherscan.png
new file mode 100644
index 000000000..48ab0de97
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-etherscan.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-pairing.png b/apps/docs/public/device-interaction/tutorial-1-pairing.png
new file mode 100644
index 000000000..707d87c0f
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-pairing.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-result.png b/apps/docs/public/device-interaction/tutorial-1-result.png
new file mode 100644
index 000000000..88bc2ac01
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-result.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-solana-create.png b/apps/docs/public/device-interaction/tutorial-1-solana-create.png
new file mode 100644
index 000000000..396716978
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-solana-create.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-solana-info.png b/apps/docs/public/device-interaction/tutorial-1-solana-info.png
new file mode 100644
index 000000000..2885d89be
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-solana-info.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-solana-pairing.png b/apps/docs/public/device-interaction/tutorial-1-solana-pairing.png
new file mode 100644
index 000000000..b84be65af
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-solana-pairing.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-solana-transaction.png b/apps/docs/public/device-interaction/tutorial-1-solana-transaction.png
new file mode 100644
index 000000000..f66df74ad
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-solana-transaction.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-solana-wallet.png b/apps/docs/public/device-interaction/tutorial-1-solana-wallet.png
new file mode 100644
index 000000000..64fe389f8
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-solana-wallet.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-solana.png b/apps/docs/public/device-interaction/tutorial-1-solana.png
new file mode 100644
index 000000000..857e007bb
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-solana.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-view.png b/apps/docs/public/device-interaction/tutorial-1-view.png
new file mode 100644
index 000000000..2a5c6d619
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-view.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-1-view2.png b/apps/docs/public/device-interaction/tutorial-1-view2.png
new file mode 100644
index 000000000..792792576
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-1-view2.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-changedata.png b/apps/docs/public/device-interaction/tutorial-2-changedata.png
new file mode 100644
index 000000000..aa3ed53c1
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-changedata.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-connect.png b/apps/docs/public/device-interaction/tutorial-2-connect.png
new file mode 100644
index 000000000..b29934eec
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-connect.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-etherscan1.png b/apps/docs/public/device-interaction/tutorial-2-etherscan1.png
new file mode 100644
index 000000000..cf1f08766
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-etherscan1.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-etherscan2.png b/apps/docs/public/device-interaction/tutorial-2-etherscan2.png
new file mode 100644
index 000000000..a2920d256
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-etherscan2.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-folder.png b/apps/docs/public/device-interaction/tutorial-2-folder.png
new file mode 100644
index 000000000..6c8d55725
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-folder.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-getdata.png b/apps/docs/public/device-interaction/tutorial-2-getdata.png
new file mode 100644
index 000000000..0700c524c
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-getdata.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-getdata2.png b/apps/docs/public/device-interaction/tutorial-2-getdata2.png
new file mode 100644
index 000000000..15c5bf5a1
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-getdata2.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-getdata3.png b/apps/docs/public/device-interaction/tutorial-2-getdata3.png
new file mode 100644
index 000000000..f37ed9f86
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-getdata3.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-2-pairing.png b/apps/docs/public/device-interaction/tutorial-2-pairing.png
new file mode 100644
index 000000000..a6cab8356
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-2-pairing.png differ
diff --git a/apps/docs/public/device-interaction/tutorial-infura-sepolia-faucet.png b/apps/docs/public/device-interaction/tutorial-infura-sepolia-faucet.png
new file mode 100644
index 000000000..5872ea432
Binary files /dev/null and b/apps/docs/public/device-interaction/tutorial-infura-sepolia-faucet.png differ
diff --git a/apps/docs/public/device-interaction/type-cosmos.png b/apps/docs/public/device-interaction/type-cosmos.png
new file mode 100644
index 000000000..d29beb1ea
Binary files /dev/null and b/apps/docs/public/device-interaction/type-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/validator-cosmos.png b/apps/docs/public/device-interaction/validator-cosmos.png
new file mode 100644
index 000000000..40b0cce94
Binary files /dev/null and b/apps/docs/public/device-interaction/validator-cosmos.png differ
diff --git a/apps/docs/public/device-interaction/wallet-preview.png b/apps/docs/public/device-interaction/wallet-preview.png
new file mode 100644
index 000000000..c091fccf4
Binary files /dev/null and b/apps/docs/public/device-interaction/wallet-preview.png differ
diff --git a/apps/docs/public/device-interaction/webBle1.png b/apps/docs/public/device-interaction/webBle1.png
new file mode 100644
index 000000000..422b8c28c
Binary files /dev/null and b/apps/docs/public/device-interaction/webBle1.png differ
diff --git a/apps/docs/public/device-interaction/webBle2.png b/apps/docs/public/device-interaction/webBle2.png
new file mode 100644
index 000000000..c9a993ad3
Binary files /dev/null and b/apps/docs/public/device-interaction/webBle2.png differ
diff --git a/apps/docs/public/device-interaction/webBle3.png b/apps/docs/public/device-interaction/webBle3.png
new file mode 100644
index 000000000..c9bdf757c
Binary files /dev/null and b/apps/docs/public/device-interaction/webBle3.png differ
diff --git a/apps/docs/public/device-interaction/webBle4.png b/apps/docs/public/device-interaction/webBle4.png
new file mode 100644
index 000000000..eca0c169d
Binary files /dev/null and b/apps/docs/public/device-interaction/webBle4.png differ
diff --git a/apps/docs/public/device-interaction/webapp1.png b/apps/docs/public/device-interaction/webapp1.png
new file mode 100644
index 000000000..2431004be
Binary files /dev/null and b/apps/docs/public/device-interaction/webapp1.png differ
diff --git a/apps/docs/public/device-interaction/webapp2.png b/apps/docs/public/device-interaction/webapp2.png
new file mode 100644
index 000000000..8585af37c
Binary files /dev/null and b/apps/docs/public/device-interaction/webapp2.png differ
diff --git a/apps/docs/public/device-interaction/webapp3.png b/apps/docs/public/device-interaction/webapp3.png
new file mode 100644
index 000000000..a234af770
Binary files /dev/null and b/apps/docs/public/device-interaction/webapp3.png differ
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index da8cb4e46..393157566 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -89,6 +89,9 @@ importers:
react-dom:
specifier: ^18.3.1
version: 18.3.1(react@18.3.1)
+ react-medium-image-zoom:
+ specifier: 5.1.8
+ version: 5.1.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
tailwind-merge:
specifier: ^1.14.0
version: 1.14.0
@@ -7588,6 +7591,12 @@ packages:
peerDependencies:
react: '>=15.0.0'
+ react-medium-image-zoom@5.1.8:
+ resolution: {integrity: sha512-2X4oLlEopIWg7qalR1Qpy4gPrU9CTF0DvJ7HNu5u/NwdyQWupEsje2vuMbjBz7+np8MmQ4DKJ6zGr1ofCuzB3g==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+
react-native-svg@15.3.0:
resolution: {integrity: sha512-mBHu/fdlzUbpGX8SZFxgbKvK/sgqLfDLP8uh8G7Us+zJgdjO8OSEeqHQs+kPRdQmdLJQiqPJX2WXgCl7ToTWqw==}
peerDependencies:
@@ -17608,6 +17617,11 @@ snapshots:
prop-types: 15.8.1
react: 18.3.1
+ react-medium-image-zoom@5.1.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
+ dependencies:
+ react: 18.3.1
+ react-dom: 18.3.1(react@18.3.1)
+
react-native-svg@15.3.0(react-native@0.74.3(@babel/core@7.24.7)(@babel/preset-env@7.24.7(@babel/core@7.24.7))(@types/react@18.3.12)(react@18.3.1))(react@18.3.1):
dependencies:
css-select: 5.1.0