diff --git a/apps/docs/pages/_meta.json b/apps/docs/pages/_meta.json
index 81772735..89971dca 100644
--- a/apps/docs/pages/_meta.json
+++ b/apps/docs/pages/_meta.json
@@ -19,6 +19,10 @@
"title": "Core",
"type": "page"
},
+ "simulator": {
+ "title": "Simulator",
+ "type": "page"
+ },
"examples": {
"title": "Examples",
"type": "page"
@@ -26,20 +30,5 @@
"appendix": {
"title": "Appendix",
"type": "page"
- },
- "react-link": {
- "title": "React",
- "href": "/react",
- "display": "hidden"
- },
- "core-link": {
- "title": "Core",
- "href": "/core",
- "display": "hidden"
- },
- "examples-link": {
- "title": "Examples & Tutorials",
- "href": "/examples",
- "display": "hidden"
}
}
diff --git a/apps/docs/pages/appendix/working-with-ledger-live.mdx b/apps/docs/pages/appendix/working-with-ledger-live.mdx
index 51ba54cc..73cfbc48 100644
--- a/apps/docs/pages/appendix/working-with-ledger-live.mdx
+++ b/apps/docs/pages/appendix/working-with-ledger-live.mdx
@@ -8,7 +8,7 @@ This page documents how to link the local packages of the wallet-api monorepo in
First you want to start the dev server to have every packages built and ready to be used by the application but also to have the watcher in place whenever we make changes in the Wallet-API.
-```bash
+```sh
pnpm dev
```
diff --git a/apps/docs/pages/core/getting-started.mdx b/apps/docs/pages/core/getting-started.mdx
index 728fe4ed..511a08f5 100644
--- a/apps/docs/pages/core/getting-started.mdx
+++ b/apps/docs/pages/core/getting-started.mdx
@@ -1,39 +1,37 @@
-
- # Getting Started with Ledger's Wallet API
+# Getting Started with Ledger's Wallet API
- Welcome to the getting started guide for Ledger's Wallet API. We are excited to have you onboard and look forward to
- seeing what you'll create.
+Welcome to the getting started guide for Ledger's Wallet API. We are excited to have you onboard and look forward to
+seeing what you'll create.
- Ledger's Wallet API can be integrated with both client and server-side applications, offering you flexibility and
- enabling diverse use-cases.
+Ledger's Wallet API can be integrated with both client and server-side applications, offering you flexibility and
+enabling diverse use-cases.
- ## Installation
+## Installation
- Let's begin by installing the base package.
+Let's begin by installing the base package.
- You can use your favorite package manager, npm, yarn or pnpm, to install the `@ledgerhq/wallet-api-client` package.
+You can use your favorite package manager, npm, yarn or pnpm, to install the `@ledgerhq/wallet-api-client` package.
- With npm:
+With npm:
- ```bash
- npm install @ledgerhq/wallet-api-client
- ```
+```sh
+npm install @ledgerhq/wallet-api-client
+```
- With yarn:
+With yarn:
- ```bash
- yarn add @ledgerhq/wallet-api-client
- ```
+```sh
+yarn add @ledgerhq/wallet-api-client
+```
- Or with pnpm:
+Or with pnpm:
- ```bash
- pnpm add @ledgerhq/wallet-api-client
- ```
+```sh
+pnpm add @ledgerhq/wallet-api-client
+```
- ---
+---
- Now that you've successfully installed the necessary packages, you're ready to start crafting with Ledger's Wallet
- API. In the next page, we'll guide you through the process of setting up and configuring the Wallet API in your
- application.
-
\ No newline at end of file
+Now that you've successfully installed the necessary packages, you're ready to start crafting with Ledger's Wallet
+API. In the next page, we'll guide you through the process of setting up and configuring the Wallet API in your
+application.
diff --git a/apps/docs/pages/core/index.mdx b/apps/docs/pages/core/index.mdx
index ce475bde..14ea7107 100644
--- a/apps/docs/pages/core/index.mdx
+++ b/apps/docs/pages/core/index.mdx
@@ -5,9 +5,9 @@ import { Callout } from "nextra/components";
This library serves as a cornerstone for integrating applications within Ledger Live, dubbed as Live Apps, in a framework-agnostic manner. By leveraging the Wallet API Client, your Live App can interact with Ledger hardware wallets through Ledger Live.
- **Migration from Platform SDK:** If you are migrating from Platform SDK, please refer to [this
- section](/appendix/migration-guide) that will
- guide you through the process.
+ **Migration from Platform SDK:** If you are migrating from Platform SDK,
+ please refer to [this section](/appendix/migration-guide) that will guide you
+ through the process.
## Target Audience
@@ -34,8 +34,8 @@ The Wallet API Client library empowers your Live App to:
This documentation is structured to provide you with a clear understanding of the various features and utilities available in the Ledger Wallet API Client library.
-- **Getting Started**: If you鈥檙e new to this library, the [Getting Started](./getting-started.md) section is the perfect launchpad. It navigates you through the installation and initial setup.
+- **Getting Started**: If you'e new to this library, the [Getting Started](/core/getting-started) section is the perfect launchpad. It navigates you through the installation and initial setup.
-- **Configuration**: The [Configuration](./configuration.md) section imparts insights on how to integrate your application with Ledger Live.
+- **Configuration**: The [Configuration](/core/configuration.mdx) section imparts insights on how to integrate your application with Ledger Live.
-- **Modules and Utilities**: Acquaint yourself with various modules and utilities for account management, message signing, transaction handling, and more in dedicated sections. Each section elucidates explanations, parameters, and practical applications.
\ No newline at end of file
+- **Modules and Utilities**: Acquaint yourself with various modules and utilities for account management, message signing, transaction handling, and more in dedicated sections. Each section elucidates explanations, parameters, and practical applications.
diff --git a/apps/docs/pages/examples/_meta.json b/apps/docs/pages/examples/_meta.json
index 16ad16ed..25e32430 100644
--- a/apps/docs/pages/examples/_meta.json
+++ b/apps/docs/pages/examples/_meta.json
@@ -2,6 +2,9 @@
"live-app-creation": {
"title": "Build a live app from scratch"
},
+ "use-live-app": {
+ "title": "Use your live app"
+ },
"test-live-app": {
"title": "Test your live app"
}
diff --git a/apps/docs/pages/examples/test-live-app/_meta.json b/apps/docs/pages/examples/test-live-app/_meta.json
index 4d0569b6..b49f6dff 100644
--- a/apps/docs/pages/examples/test-live-app/_meta.json
+++ b/apps/docs/pages/examples/test-live-app/_meta.json
@@ -1,6 +1,4 @@
{
"prerequisites": "Prerequisites",
- "manifest": "Create a manifest",
- "import": "Import your manifest",
- "interact": "Interact with Developer tools"
+ "testing": "Testing"
}
diff --git a/apps/docs/pages/examples/test-live-app/prerequisites.mdx b/apps/docs/pages/examples/test-live-app/prerequisites.mdx
index 242c2549..365df55e 100644
--- a/apps/docs/pages/examples/test-live-app/prerequisites.mdx
+++ b/apps/docs/pages/examples/test-live-app/prerequisites.mdx
@@ -1,8 +1,8 @@
# Prerequisites
-This tutorial assumes that you already have your dapp using the wallet-api package.
+This tutorial assumes that you already have your Live App using the Wallet-API package.
-To start will need at least :
-
-- a [Ledger Device](https://shop.ledger.com/pages/hardware-wallets-comparison) (Nano S or X). You will need one to access Ledger Live.
+To start we'll need at least:
+- To setup the simulator as shown in the [documentation](/simulator/configuration)
+- And have a test environment in place like jest or vitest
diff --git a/apps/docs/pages/examples/test-live-app/testing.mdx b/apps/docs/pages/examples/test-live-app/testing.mdx
new file mode 100644
index 00000000..44d95aa6
--- /dev/null
+++ b/apps/docs/pages/examples/test-live-app/testing.mdx
@@ -0,0 +1,17 @@
+import { Callout } from "nextra/components";
+
+# Automated testing
+
+
+ Docs for this is under construction.
+
+
+In order to test your Live App in an automated way, you will first need to create a test file.
+
+Here is a simple example of a test file written for a Live App:
+
+```ts
+describe("List accounts", () => {
+ test("It should show the list of accounts when clicking the button", () => {});
+});
+```
diff --git a/apps/docs/pages/examples/use-live-app/_meta.json b/apps/docs/pages/examples/use-live-app/_meta.json
new file mode 100644
index 00000000..4d0569b6
--- /dev/null
+++ b/apps/docs/pages/examples/use-live-app/_meta.json
@@ -0,0 +1,6 @@
+{
+ "prerequisites": "Prerequisites",
+ "manifest": "Create a manifest",
+ "import": "Import your manifest",
+ "interact": "Interact with Developer tools"
+}
diff --git a/apps/docs/pages/examples/use-live-app/assets/3-1-developer-mode.png b/apps/docs/pages/examples/use-live-app/assets/3-1-developer-mode.png
new file mode 100644
index 00000000..78f99d4d
Binary files /dev/null and b/apps/docs/pages/examples/use-live-app/assets/3-1-developer-mode.png differ
diff --git a/apps/docs/pages/examples/use-live-app/assets/3-2-dev-tools.png b/apps/docs/pages/examples/use-live-app/assets/3-2-dev-tools.png
new file mode 100644
index 00000000..6dd92975
Binary files /dev/null and b/apps/docs/pages/examples/use-live-app/assets/3-2-dev-tools.png differ
diff --git a/apps/docs/pages/examples/use-live-app/assets/3-3-browse.png b/apps/docs/pages/examples/use-live-app/assets/3-3-browse.png
new file mode 100644
index 00000000..6dfde298
Binary files /dev/null and b/apps/docs/pages/examples/use-live-app/assets/3-3-browse.png differ
diff --git a/apps/docs/pages/examples/use-live-app/assets/3-4-local-app.png b/apps/docs/pages/examples/use-live-app/assets/3-4-local-app.png
new file mode 100644
index 00000000..da421d24
Binary files /dev/null and b/apps/docs/pages/examples/use-live-app/assets/3-4-local-app.png differ
diff --git a/apps/docs/pages/examples/use-live-app/assets/4-1-open-local-app.png b/apps/docs/pages/examples/use-live-app/assets/4-1-open-local-app.png
new file mode 100644
index 00000000..cb7d4c99
Binary files /dev/null and b/apps/docs/pages/examples/use-live-app/assets/4-1-open-local-app.png differ
diff --git a/apps/docs/pages/examples/test-live-app/import.mdx b/apps/docs/pages/examples/use-live-app/import.mdx
similarity index 79%
rename from apps/docs/pages/examples/test-live-app/import.mdx
rename to apps/docs/pages/examples/use-live-app/import.mdx
index bdc9cc92..4a5ffa7a 100644
--- a/apps/docs/pages/examples/test-live-app/import.mdx
+++ b/apps/docs/pages/examples/use-live-app/import.mdx
@@ -6,10 +6,10 @@ You also need your Ledger Device (Nano S or X) in order to access Ledger Live.
In order to add a local manifest to Ledger Live and run a not yet available Live App, you must enable the Developer mode.
-To activate the Developer mode in Ledger Live, go to :
+To activate the Developer mode in Ledger Live, go to :
-1) **Settings** -> **About**
-2) Click ten times on the Ledger Live version.
+1. **Settings** -> **About**
+2. Click ten times on the Ledger Live version.
You will then see a new **Developer** section in the settings menu.
@@ -19,7 +19,7 @@ Once done, make sure to turn on **Enable platform dev tools** as it will allow y
![dev-tools](./assets/3-2-dev-tools.png)
-Then click on **Browse** next to **Add a local app** and select the manifest you created in the [previous section](./2-manifest.md).
+Then click on **Browse** next to **Add a local app** and select the manifest you created in the [previous section](/examples/use-live-app/manifest.mdx).
![browse](./assets/3-3-browse.png)
@@ -27,6 +27,6 @@ You will then see a new row in the menu with the name of your Live App.
![local-app](./assets/3-4-local-app.png)
-Now that you have added your Live App in your local Ledger Live application, it鈥檚 time to open it and test it.
+Now that you have added your Live App in your local Ledger Live application, it鈥檚 time to open it and test it.
We鈥檒l see this in the next section.
diff --git a/apps/docs/pages/examples/test-live-app/interact.mdx b/apps/docs/pages/examples/use-live-app/interact.mdx
similarity index 100%
rename from apps/docs/pages/examples/test-live-app/interact.mdx
rename to apps/docs/pages/examples/use-live-app/interact.mdx
diff --git a/apps/docs/pages/examples/test-live-app/manifest.mdx b/apps/docs/pages/examples/use-live-app/manifest.mdx
similarity index 100%
rename from apps/docs/pages/examples/test-live-app/manifest.mdx
rename to apps/docs/pages/examples/use-live-app/manifest.mdx
diff --git a/apps/docs/pages/examples/use-live-app/prerequisites.mdx b/apps/docs/pages/examples/use-live-app/prerequisites.mdx
new file mode 100644
index 00000000..56c55542
--- /dev/null
+++ b/apps/docs/pages/examples/use-live-app/prerequisites.mdx
@@ -0,0 +1,7 @@
+# Prerequisites
+
+This tutorial assumes that you already have your dapp using the wallet-api package.
+
+To start will need at least :
+
+- a [Ledger Device](https://shop.ledger.com/pages/hardware-wallets-comparison) (Nano S or X). You will need one to access Ledger Live.
diff --git a/apps/docs/pages/react/_meta.json b/apps/docs/pages/react/_meta.json
index f41eba23..1ed7bf42 100644
--- a/apps/docs/pages/react/_meta.json
+++ b/apps/docs/pages/react/_meta.json
@@ -20,11 +20,5 @@
"toc": true
}
},
- "simulator": {
- "title": "Simulator",
- "theme": {
- "toc": true
- }
- },
"hooks": "Hooks"
}
diff --git a/apps/docs/pages/react/configuration.mdx b/apps/docs/pages/react/configuration.mdx
index 646bb0e5..453a716c 100644
--- a/apps/docs/pages/react/configuration.mdx
+++ b/apps/docs/pages/react/configuration.mdx
@@ -63,4 +63,4 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
With this setup, the entire application can access Ledger's Wallet API and communicate with it via the `TransportProvider`.
-You are now almost ready to use the wallet API's functionalities. The last step is to make your Live App ready to be registered by creating your manifest. You can head to this section to learn about [how to create your manifest](/examples-and-tutorials/test-live-app/manifest)
+You are now almost ready to use the wallet API's functionalities. The last step is to make your Live App ready to be registered by creating your manifest. You can head to this section to learn about [how to create your manifest](/examples/use-live-app/manifest)
diff --git a/apps/docs/pages/react/getting-started.mdx b/apps/docs/pages/react/getting-started.mdx
index 67850520..96275532 100644
--- a/apps/docs/pages/react/getting-started.mdx
+++ b/apps/docs/pages/react/getting-started.mdx
@@ -1,90 +1,88 @@
-
- # Getting Started with Ledger's Wallet API
+# Getting Started with Ledger's Wallet API
- Welcome to the getting started guide for Ledger's Wallet API. We are excited to have you onboard and look forward to
- seeing what you'll create.
+Welcome to the getting started guide for Ledger's Wallet API. We are excited to have you onboard and look forward to
+seeing what you'll create.
- Ledger's Wallet API can be integrated with both client and server-side applications, offering you flexibility and
- enabling diverse use-cases.
+Ledger's Wallet API can be integrated with both client and server-side applications, offering you flexibility and
+enabling diverse use-cases.
- ## Installation
+## Installation
- Let's begin by installing the base package.
+Let's begin by installing the base package.
- You can use your favorite package manager, npm, yarn or pnpm, to install the `@ledgerhq/wallet-api-client` package.
+You can use your favorite package manager, npm, yarn or pnpm, to install the `@ledgerhq/wallet-api-client` package.
- With npm:
+With npm:
- ```bash
- npm install @ledgerhq/wallet-api-client
- ```
+```sh
+npm install @ledgerhq/wallet-api-client
+```
- With yarn:
+With yarn:
- ```bash
- yarn add @ledgerhq/wallet-api-client
- ```
+```sh
+yarn add @ledgerhq/wallet-api-client
+```
- Or with pnpm:
+Or with pnpm:
- ```bash
- pnpm add @ledgerhq/wallet-api-client
- ```
+```sh
+pnpm add @ledgerhq/wallet-api-client
+```
- ### Using Ledger's Wallet API with React
+### Using Ledger's Wallet API with React
- For those working with a React project, we offer a specific package to facilitate easy integration of the Wallet API:
- `@ledgerhq/wallet-api-client-react`.
+For those working with a React project, we offer a specific package to facilitate easy integration of the Wallet API:
+`@ledgerhq/wallet-api-client-react`.
- To install it using npm:
+To install it using npm:
- ```bash
- npm install @ledgerhq/wallet-api-client-react
- ```
+```sh
+npm install @ledgerhq/wallet-api-client-react
+```
- With yarn:
+With yarn:
- ```bash
- yarn add @ledgerhq/wallet-api-client-react
- ```
+```sh
+yarn add @ledgerhq/wallet-api-client-react
+```
- Or with pnpm:
+Or with pnpm:
- ```bash
- pnpm add @ledgerhq/wallet-api-client-react
- ```
+```sh
+pnpm add @ledgerhq/wallet-api-client-react
+```
- This package provides handy React hooks to interact with Ledger's Wallet API.
+This package provides handy React hooks to interact with Ledger's Wallet API.
- ### Testing with Simulator
+### Testing with Simulator
- To test the Wallet API without connecting to the Ledger Live App directly, you can use the
- `@ledgerhq/wallet-api-simulator` package.
+To test the Wallet API without connecting to the Ledger Live App directly, you can use the
+`@ledgerhq/wallet-api-simulator` package.
- Install it using npm:
+Install it using npm:
- ```bash
- npm install @ledgerhq/wallet-api-simulator
- ```
+```sh
+npm install @ledgerhq/wallet-api-simulator
+```
- With yarn:
+With yarn:
- ```bash
- yarn add @ledgerhq/wallet-api-simulator
- ```
+```sh
+yarn add @ledgerhq/wallet-api-simulator
+```
- Or with pnpm:
+Or with pnpm:
- ```bash
- pnpm add @ledgerhq/wallet-api-simulator
- ```
+```sh
+pnpm add @ledgerhq/wallet-api-simulator
+```
- Remember, this package currently only functions with server-side applications due to a dependency requiring the usage
- of `process`.
+Remember, this package currently only functions with server-side applications due to a dependency requiring the usage
+of `process`.
- ---
+---
- Now that you've successfully installed the necessary packages, you're ready to start crafting with Ledger's Wallet
- API. In the next page, we'll guide you through the process of setting up and configuring the Wallet API in your
- application.
-
\ No newline at end of file
+Now that you've successfully installed the necessary packages, you're ready to start crafting with Ledger's Wallet
+API. In the next page, we'll guide you through the process of setting up and configuring the Wallet API in your
+application.
diff --git a/apps/docs/pages/react/index.mdx b/apps/docs/pages/react/index.mdx
index 5bfac9e7..c702bc9e 100644
--- a/apps/docs/pages/react/index.mdx
+++ b/apps/docs/pages/react/index.mdx
@@ -7,14 +7,14 @@ This library is exclusively designed to facilitate the seamless integration of d
Whether you are developing a crypto asset management app, a decentralized exchange, or any other blockchain project, this library is equipped with a set of React hooks and utilities to ensure a secure and efficient user experience.
- **Migration from Platform SDK:** If you are migrating from Platform SDK, please refer to [this
- section](/appendix/migration-guide) that will
- guide you through the process.
+ **Migration from Platform SDK:** If you are migrating from Platform SDK,
+ please refer to [this section](/appendix/migration-guide) that will guide you
+ through the process.
## Target Audience
-This documentation and the Wallet API library are dedicated to developers building Live Apps that are intended to be embedded within Ledger Live. It ensures smooth communication between the Live App and the user鈥檚 Ledger hardware wallet through [Ledger Live](https://www.ledger.com/ledger-live).
+This documentation and the Wallet API library are dedicated to developers building Live Apps that are intended to be embedded within Ledger Live. It ensures smooth communication between the Live App and the user's Ledger hardware wallet through [Ledger Live](https://www.ledger.com/ledger-live).
We expect to widen the scope of the library in the future to support other use cases as well such as web apps connected to Ledger wallets though the [Ledger Extension](https://www.ledger.com/ledger-extension), but this is not yet supported.
@@ -36,14 +36,14 @@ The Wallet API Client React library empowers your Live App to:
This documentation is structured to provide you with a clear understanding of the various features and utilities available in the Ledger Wallet API Client React library.
-- **Getting Started**: If you鈥檙e new to this library, begin with the [Getting Started](./getting-started.md) section. It guides you through the installation process.
+- **Getting Started**: If you're new to this library, begin with the [Getting Started](/react/getting-started) section. It guides you through the installation process.
-- **Configuration**: The [Configuration](./configuration.md) section contains information on how to plug your application to Ledger Live.
+- **Configuration**: The [Configuration](/react/configuration) section contains information on how to plug your application to Ledger Live.
- **Hooks and Utilities**: Learn about the various hooks like `useAccounts`, `useRequestAccount`, `useSignMessage`, and more, as well as utilities for transaction management in dedicated sections. Each section includes explanations, parameters, and use cases.
-- **Migration Guide**: If you are migrating from the Platform SDK (version 1 of this library) to the Wallet API (version 2 and current), refer to the [Migration Guide](./migration-guide.md) for a guided transition.
+- **Migration Guide**: If you are migrating from the Platform SDK (version 1 of this library) to the Wallet API (version 2 and current), refer to the [Migration Guide](/appendix/migration-guide) for a guided transition.
-- **Families**: For a comprehensive list of supported blockchains, visit the [Families](./families.md) section. Each blockchain is detailed with its features and capabilities within the library.
+- **Families**: For a comprehensive list of supported blockchains, visit the [Families](/appendix/families) section. Each blockchain is detailed with its features and capabilities within the library.
-We're thrilled to have you on board and excited to see the innovative Live Apps you build.
\ No newline at end of file
+We're thrilled to have you on board and excited to see the innovative Live Apps you build.
diff --git a/apps/docs/pages/react/simulator.mdx b/apps/docs/pages/react/simulator.mdx
deleted file mode 100644
index 9e2195e3..00000000
--- a/apps/docs/pages/react/simulator.mdx
+++ /dev/null
@@ -1,132 +0,0 @@
-import { Callout } from "nextra/components";
-
-In this guide, we will walk through how to set up the Ledger Wallet API client to connect to a mock environment, called "The Simulator", instead of the real Ledger Live environment. This is especially helpful during development and testing phases, where you might not want to perform actions on the real Ledger Live.
-
-### Introduction
-
-The Simulator is a tool provided by Ledger that allows developers to test their application without interacting with the real Ledger Live application. It provides a mock environment with a set of predefined responses for different Wallet API actions. This enables you to develop and test your application safely.
-
-### Installing the Simulator
-
-Before proceeding, make sure that you have both the Ledger Wallet API client and the Simulator library installed in your project. You can install the Simulator library using npm:
-
-```sh
-npm install @ledgerhq/wallet-api-simulator
-```
-
-
- **Please Note:** The `@ledgerhq/wallet-api-simulator` package currently only functions with server-side
- applications.
- This is due to a dependency requiring `process`, which is polyfilled inside Server Side Rendering (SSR) frameworks
- like Next.js or Remix. We are actively working to remove that dependency and will update this guide once it is
- available.
-
-
-### Launching Live App from Browser
-
-One of the benefits of using the Simulator is that it allows developers to launch their Live App from any browser, without the need to launch it from within Ledger Live. This greatly simplifies the development and testing process as it removes the dependency on the Ledger Live application.
-
-### Connecting to the Simulator
-
-To connect to the Simulator, you will need to modify your `TransportProvider.tsx` file. Specifically, you need to use the `getSimulatorTransport` function provided by the Simulator library.
-
-Here鈥檚 how the modified `TransportProvider.tsx` file should look like:
-
-```jsx
-import { WalletAPIProvider } from "@ledgerhq/wallet-api-client-react";
-import { getSimulatorTransport, profiles } from "@ledgerhq/wallet-api-simulator";
-import type { Transport } from "@ledgerhq/wallet-api-core";
-
-function TransportProvider({ children }) {
- function getWalletAPITransport(): Transport {
- if (typeof window === "undefined") {
- return {
- onMessage: undefined,
- send: () => {},
- };
- }
-
- // Use Simulator transport
- const transport = getSimulatorTransport(profiles.STANDARD);
-
- return transport;
- }
-
- const transport = getWalletAPITransport();
-
- return (
- {children}
- );
-}
-
-export default TransportProvider;
-```
-
-In this file, the `getSimulatorTransport` function is passed a predefined profile, which is `profiles.STANDARD`. This sets up the transport to use the Simulator.
-
-### Understanding the Simulator Profiles
-
-The Simulator provides different profiles. These profiles are predefined sets of responses for various API actions.
-For now, we recommend that you use `profiles.STANDARD` which includes a set of mock accounts, mock currencies, and method handlers.
-
-### Mock Accounts and Currencies
-
-The Simulator is set up with a predefined list of mock accounts and currencies. Here鈥檚 a brief overview of the mock accounts and currencies used within the simulator:
-
-### Mock Accounts
-
-```json
-[
- {
- "id": "account-btc-1",
- "name": "Bitcoin 1",
- "address": "address",
- "currency": "bitcoin",
- "balance": "42",
- "spendableBalance": "42",
- "blockHeight": 1,
- "lastSyncDate": "1995-12-17T03:24:00"
- },
- {
- "id": "account-eth-1",
- "name": "Ethereum 1",
- "address": "address",
- "currency": "ethereum",
- "balance": "42",
- "spendableBalance": "42",
- "blockHeight": 1,
- "lastSyncDate": "1995-12-17T03:24:00"
- }
-]
-```
-
-### Mock Currencies
-
-```json
-[
- {
- "type": "CryptoCurrency",
- "id": "bitcoin",
- "ticker": "BTC",
- "name": "Bitcoin",
- "family": "bitcoin",
- "color": "#ffae35",
- "decimals": 8
- },
- {
- "type": "CryptoCurrency",
- "id": "ethereum",
- "ticker": "ETH",
- "name": "Ethereum",
- "family": "ethereum",
- "color": "#0ebdcd",
- "decimals": 18
- }
-]
-```
-
-These mock accounts and currencies are used to emulate a realistic Ledger Live environment. You can interact with these accounts and currencies through the API without affecting any real-world assets.
-
-### Wrapping Up
-
-By using the Simulator, you can streamline the development and testing of your application with the Ledger Wallet API. This allows you to develop and test your Ledger Live integration in a safe and controlled environment. Don't forget to thoroughly test with real devices and the live environment before releasing your application.
\ No newline at end of file
diff --git a/apps/docs/pages/simulator/_meta.json b/apps/docs/pages/simulator/_meta.json
new file mode 100644
index 00000000..7aadc5a3
--- /dev/null
+++ b/apps/docs/pages/simulator/_meta.json
@@ -0,0 +1,29 @@
+{
+ "index": {
+ "title": "Introduction",
+ "theme": {
+ "breadcrumb": false,
+ "footer": true,
+ "sidebar": true,
+ "toc": true
+ }
+ },
+ "getting-started": {
+ "title": "Getting Started",
+ "theme": {
+ "toc": true
+ }
+ },
+ "configuration": {
+ "title": "Configuration",
+ "theme": {
+ "toc": true
+ }
+ },
+ "profiles": {
+ "title": "Profiles",
+ "theme": {
+ "toc": true
+ }
+ }
+}
diff --git a/apps/docs/pages/simulator/configuration.mdx b/apps/docs/pages/simulator/configuration.mdx
new file mode 100644
index 00000000..899a3b13
--- /dev/null
+++ b/apps/docs/pages/simulator/configuration.mdx
@@ -0,0 +1,72 @@
+# Configuring the simulator
+
+### Launching Live App from Browser
+
+One of the benefits of using the Simulator is that it allows developers to launch their Live App from any browser, without the need to launch it from within Ledger Live. This greatly simplifies the development and testing process as it removes the dependency on the Ledger Live application.
+
+### Connecting to the Simulator
+
+To connect to the Simulator, you will need to modify your `TransportProvider.tsx` file. Specifically, you need to use the `getSimulatorTransport` function provided by the Simulator library.
+
+Here's how the modified `TransportProvider.tsx` file should look like:
+
+```jsx
+import { WalletAPIProvider } from "@ledgerhq/wallet-api-client-react";
+import { getSimulatorTransport, profiles } from "@ledgerhq/wallet-api-simulator";
+import type { Transport } from "@ledgerhq/wallet-api-core";
+
+function TransportProvider({ children }) {
+ function getWalletAPITransport(): Transport {
+ if (typeof window === "undefined") {
+ return {
+ onMessage: undefined,
+ send: () => {},
+ };
+ }
+
+ // Use Simulator transport
+ const transport = getSimulatorTransport(profiles.STANDARD);
+
+ return transport;
+ }
+
+ const transport = getWalletAPITransport();
+
+ return (
+ {children}
+ );
+}
+
+export default TransportProvider;
+```
+
+In this file, the `getSimulatorTransport` function is passed a predefined profile, which is `profiles.STANDARD`. This sets up the transport to use the Simulator.
+
+Let's break it down:
+
+- We import the necessary components and types from the Ledger's Wallet API packages.
+- The `TransportProvider` function component is created. This component receives its children as a prop and renders them within the `WalletAPIProvider`.
+- The `getWalletAPITransport` function provides a transport method for the `WalletAPIProvider`. It checks if the `window` object is defined (which it wouldn't be during server-side rendering) and returns an empty transport object if it's not.
+- If the `window` object is available, it initialises a `WindowMessageTransport`, connects it, and returns it as the transport method. This allows the app to communicate with the Ledger Wallet API through window messages.
+- The `WalletAPIProvider` is provided with the transport object returned by `getWalletAPITransport`. This setup allows the rest of your app (represented by `{children}`) to communicate with the Ledger Wallet API.
+
+After creating this `TransportProvider.tsx` file, you need to wrap your `` with the `TransportProvider` in your root file. This would typically look like the following:
+
+```jsx
+import React from 'react';
+import ReactDOM from 'react-dom';
+import App from './App';
+import TransportProvider from './TransportProvider';
+
+ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
+
+
+
+
+
+);
+```
+
+With this setup, the entire application can access Ledger's Wallet API and communicate with it via the `TransportProvider`.
+
+You are now almost ready to use the wallet API's functionalities. The last step is to make your Live App ready to be registered by creating your manifest. You can head to this section to learn about [how to create your manifest](/examples/use-live-app/manifest)
diff --git a/apps/docs/pages/simulator/getting-started.mdx b/apps/docs/pages/simulator/getting-started.mdx
new file mode 100644
index 00000000..8782be63
--- /dev/null
+++ b/apps/docs/pages/simulator/getting-started.mdx
@@ -0,0 +1,21 @@
+# Getting Started
+
+In this guide, we will walk through how to set up the Ledger Wallet API simulator to connect the client to a mock environment, instead of the real Ledger Live environment.
+
+This is especially helpful during development and testing phases, where you might not want to perform actions on the real Ledger Live.
+
+## Installation
+
+Let's begin by installing the base package.
+
+You can use your favorite package manager, npm, yarn or pnpm, to install the `@ledgerhq/wallet-api-simulator` package.
+
+```sh npm2yarn
+npm install @ledgerhq/wallet-api-simulator
+```
+
+---
+
+Now that you've successfully installed the necessary packages, you're ready to start crafting with Ledger's Wallet
+API. In the next page, we'll guide you through the process of setting up and configuring the Wallet API in your
+application.
diff --git a/apps/docs/pages/simulator/index.mdx b/apps/docs/pages/simulator/index.mdx
new file mode 100644
index 00000000..4d488d13
--- /dev/null
+++ b/apps/docs/pages/simulator/index.mdx
@@ -0,0 +1,34 @@
+import { Callout } from "nextra/components";
+
+# Wallet API Simulator
+
+The Simulator is a tool provided by Ledger that allows developers to test their application without interacting with the real Ledger Live application.
+
+It provides a mock environment with a set of predefined responses for different Wallet API actions.
+This enables you to develop and test your application safely.
+
+## Target audience
+
+This documentation and the Wallet API library are dedicated to developers building Live Apps that are intended to be embedded within a wallet implementing the Wallet API Server like [Ledger Live](https://www.ledger.com/ledger-live).
+
+## Overview
+
+The Wallet API Simulator library empowers you to:
+
+- **Easily develop your Live App in the browser**: Establish a fake connection to the Simulator acting as a wallet implementing the Wallet API Server, like Ledger Live would do.
+
+- **Test in more ways**: The simulator facilitate writing E2E, integration or unit tests, by allowing mocking any data used.
+
+- **Simulate errors that are hard to reproduce**: Just like you can write tests for the good path, you should also test your error handling code.
+
+## Navigating the documentation
+
+This documentation is structured to provide you with a clear understanding of the various features and utilities available in the Ledger Wallet API Simulator library.
+
+- **Getting Started**: If you're new to this library, begin with the [Getting Started](/simulator/getting-started.mdx) section. It guides you through the installation process.
+
+- **Configuration**: The [Configuration](/simulator/configuration.mdx) section contains information on how to add the simulator to your Live App.
+
+- **Profiles**: Learn about the various [Profiles](/simulator/profiles.mdx) we export for use with the simulator, as well as utilities to customize the profiles.
+
+We're thrilled to have you on board and excited to see the innovative Live Apps you build.
diff --git a/apps/docs/pages/simulator/profiles.mdx b/apps/docs/pages/simulator/profiles.mdx
new file mode 100644
index 00000000..4b280a1c
--- /dev/null
+++ b/apps/docs/pages/simulator/profiles.mdx
@@ -0,0 +1,68 @@
+import { Callout } from "nextra/components";
+
+# Understanding the Simulator Profiles
+
+The Simulator provides different profiles. These profiles are predefined sets of responses for various API actions.
+For now, we recommend that you use `profiles.STANDARD` which includes a set of mock accounts, mock currencies, and method handlers.
+
+### Mock Accounts and Currencies
+
+The Simulator is set up with a predefined list of mock accounts and currencies. Here鈥檚 a brief overview of the mock accounts and currencies used within the simulator:
+
+### Mock Accounts
+
+```json
+[
+ {
+ "id": "account-btc-1",
+ "name": "Bitcoin 1",
+ "address": "address",
+ "currency": "bitcoin",
+ "balance": "42",
+ "spendableBalance": "42",
+ "blockHeight": 1,
+ "lastSyncDate": "1995-12-17T03:24:00"
+ },
+ {
+ "id": "account-eth-1",
+ "name": "Ethereum 1",
+ "address": "address",
+ "currency": "ethereum",
+ "balance": "42",
+ "spendableBalance": "42",
+ "blockHeight": 1,
+ "lastSyncDate": "1995-12-17T03:24:00"
+ }
+]
+```
+
+### Mock Currencies
+
+```json
+[
+ {
+ "type": "CryptoCurrency",
+ "id": "bitcoin",
+ "ticker": "BTC",
+ "name": "Bitcoin",
+ "family": "bitcoin",
+ "color": "#ffae35",
+ "decimals": 8
+ },
+ {
+ "type": "CryptoCurrency",
+ "id": "ethereum",
+ "ticker": "ETH",
+ "name": "Ethereum",
+ "family": "ethereum",
+ "color": "#0ebdcd",
+ "decimals": 18
+ }
+]
+```
+
+These mock accounts and currencies are used to emulate a realistic Ledger Live environment. You can interact with these accounts and currencies through the API without affecting any real-world assets.
+
+### Wrapping Up
+
+By using the Simulator, you can streamline the development and testing of your application with the Ledger Wallet API. This allows you to develop and test your Ledger Live integration in a safe and controlled environment. Don't forget to thoroughly test with real devices and the live environment before releasing your application.
diff --git a/packages/client-react/README.md b/packages/client-react/README.md
index dd95d05f..26758aaf 100644
--- a/packages/client-react/README.md
+++ b/packages/client-react/README.md
@@ -50,7 +50,7 @@ Please read our [contribution guidelines](./CONTRIBUTING.md) before getting star
The dependencies should be installed from the root directory
-```bash
+```sh
pnpm i
```
@@ -58,7 +58,7 @@ pnpm i
Build the client from the [root directory](../..)
-```bash
+```sh
pnpm build:client
```
@@ -66,13 +66,13 @@ pnpm build:client
Check code formatting with
-```bash
+```sh
pnpm format:check
```
Format source (`src`) files in-place with
-```bash
+```sh
pnpm format:fix
```
@@ -80,13 +80,13 @@ pnpm format:fix
Check code quality with
-```bash
+```sh
pnpm lint
```
Automatically fix code quality problems with
-```bash
+```sh
pnpm lint:fix
```
diff --git a/packages/client/README.md b/packages/client/README.md
index e69a44e1..1dcd5ff3 100644
--- a/packages/client/README.md
+++ b/packages/client/README.md
@@ -1,6 +1,6 @@
-
WalletAPI Client SDK
+ WalletAPI Client
Integrate your application or service inside Ledger Live
@@ -12,7 +12,7 @@
-
+
@@ -50,7 +50,7 @@ Please read our [contribution guidelines](./CONTRIBUTING.md) before getting star
The dependencies should be installed from the root directory
-```bash
+```sh
pnpm i
```
@@ -58,7 +58,7 @@ pnpm i
Build the client from the [root directory](../..)
-```bash
+```sh
pnpm build:client
```
@@ -66,13 +66,13 @@ pnpm build:client
Check code formatting with
-```bash
+```sh
pnpm format:check
```
Format source (`src`) files in-place with
-```bash
+```sh
pnpm format:fix
```
@@ -80,13 +80,13 @@ pnpm format:fix
Check code quality with
-```bash
+```sh
pnpm lint
```
Automatically fix code quality problems with
-```bash
+```sh
pnpm lint:fix
```
diff --git a/packages/manifest-validator-cli/README.md b/packages/manifest-validator-cli/README.md
index 7ca9503b..26758aaf 100644
--- a/packages/manifest-validator-cli/README.md
+++ b/packages/manifest-validator-cli/README.md
@@ -1,23 +1,37 @@
-
@ledgerhq/wallet-api-manifest-validator
- Verify your Live App manifest
+ WalletAPI Client React Integration
+ Easily connect your react application to Ledger's wallet-api
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
- About the manifest
+ Full documentation
路
Report Bug
路
@@ -25,97 +39,61 @@
-## Quick intro
-
-The manifest Validator is a typescript package that checks if your `manifest.json` file meets the requirements for a Wallet App manifest submission.
-
-To achieve this, the package uses [JSON Schema](https://json-schema.org/), a vocabulary for annotating and validating JSON documents.
+# Contributing
-In top of that, we use the [AJV](https://ajv.js.org/) and [AJV-errors](https://www.npmjs.com/package/ajv-errors) libraries which provides more possibilities (please refer to [AJV Github](https://github.com/ajv-validator/ajv) to know which version of JSON Schema we use).
+Please read our [contribution guidelines](./CONTRIBUTING.md) before getting started.
-## Installation
+**You need to have a recent [Node.js](https://nodejs.org/) and
+[pnPM](https://pnpm.io/) installed.**
-```bash
-npm i @ledgerhq/wallet-api-manifest-validator
-
-```
+### Install dependencies
-_Can also be used globaly:_
+The dependencies should be installed from the root directory
-```bash
-npm i -g @ledgerhq/wallet-api-manifest-validator
+```sh
+pnpm i
```
-## How to use
+### Build
-#### Import
+Build the client from the [root directory](../..)
-```typescript
-import { validateManifest } from "@ledgerhq/wallet-api-manifest-validator";
-import MyjsonManifestFile from "./manifest.json";
-
-const result: boolean = validateManifest(MyjsonManifestFile);
+```sh
+pnpm build:client
```
-#### CLI
+### Format
-Once you have installed it, use the command:
+Check code formatting with
-```bash
-npm run validate <*fileOrDirectoryName*>
+```sh
+pnpm format:check
```
-_Or if you have installed it in global:_
+Format source (`src`) files in-place with
-```bash
-validate <*fileOrDirectoryName*>
+```sh
+pnpm format:fix
```
-help command
-
-```bash
-npm run validate -h
-```
-
-#### More info about the validator options
-
-The validateManifest function takes 1 mandatory argument and options.
+### Lint
-**Arguments**
+Check code quality with
-| Args | Type | Description |
-| :------: | :----: | ------------------------------------------------------------- |
-| manifest | JSON | Your JSON file. NOT your path. |
-| options | Object | More details bellow |
-
-**Options**
-
-| Options | Type | Description |
-| :---------: | :-----: | ------------------------------------------------------------------------------------------- |
-| details | boolean | describe errors when they occur |
-| enableState | boolean | result description (e.g. show in console "The JSON file does not correspond to the schema") |
-| fileName | string | file name, practical to validate multiple files via multiple calls |
-
-Imported in source code:
-
-```typescript
-validateManifest(MyjsonManifestFile, { details, enableState, fileName });
+```sh
+pnpm lint
```
-_Cli command don't allow you to use the fileName option._
-_--throwError option is only available on cli._
+Automatically fix code quality problems with
-Using CLI:
+```sh
+pnpm lint:fix
+```
-```bash
-npm run validate *fileOrDirectoryName* --details --enableState --throwError
-```
+---
-
-
-
+[We are hiring, join us! 馃殌](https://www.ledger.com/join-us)
-more infos about the manifest here:
+### See also:
-https://developers.ledger.com/docs/dapp/manifest/
-https://developers.ledger.com/docs/non-dapp/tutorial/2-manifest/
\ No newline at end of file
+- [Ledger Live](https://github.com/LedgerHQ/ledger-live)
diff --git a/packages/manifest-validator/README.md b/packages/manifest-validator/README.md
index 7ca9503b..26758aaf 100644
--- a/packages/manifest-validator/README.md
+++ b/packages/manifest-validator/README.md
@@ -1,23 +1,37 @@
-
@ledgerhq/wallet-api-manifest-validator
- Verify your Live App manifest
+ WalletAPI Client React Integration
+ Easily connect your react application to Ledger's wallet-api
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
- About the manifest
+ Full documentation
路
Report Bug
路
@@ -25,97 +39,61 @@
-## Quick intro
-
-The manifest Validator is a typescript package that checks if your `manifest.json` file meets the requirements for a Wallet App manifest submission.
-
-To achieve this, the package uses [JSON Schema](https://json-schema.org/), a vocabulary for annotating and validating JSON documents.
+# Contributing
-In top of that, we use the [AJV](https://ajv.js.org/) and [AJV-errors](https://www.npmjs.com/package/ajv-errors) libraries which provides more possibilities (please refer to [AJV Github](https://github.com/ajv-validator/ajv) to know which version of JSON Schema we use).
+Please read our [contribution guidelines](./CONTRIBUTING.md) before getting started.
-## Installation
+**You need to have a recent [Node.js](https://nodejs.org/) and
+[pnPM](https://pnpm.io/) installed.**
-```bash
-npm i @ledgerhq/wallet-api-manifest-validator
-
-```
+### Install dependencies
-_Can also be used globaly:_
+The dependencies should be installed from the root directory
-```bash
-npm i -g @ledgerhq/wallet-api-manifest-validator
+```sh
+pnpm i
```
-## How to use
+### Build
-#### Import
+Build the client from the [root directory](../..)
-```typescript
-import { validateManifest } from "@ledgerhq/wallet-api-manifest-validator";
-import MyjsonManifestFile from "./manifest.json";
-
-const result: boolean = validateManifest(MyjsonManifestFile);
+```sh
+pnpm build:client
```
-#### CLI
+### Format
-Once you have installed it, use the command:
+Check code formatting with
-```bash
-npm run validate <*fileOrDirectoryName*>
+```sh
+pnpm format:check
```
-_Or if you have installed it in global:_
+Format source (`src`) files in-place with
-```bash
-validate <*fileOrDirectoryName*>
+```sh
+pnpm format:fix
```
-help command
-
-```bash
-npm run validate -h
-```
-
-#### More info about the validator options
-
-The validateManifest function takes 1 mandatory argument and options.
+### Lint
-**Arguments**
+Check code quality with
-| Args | Type | Description |
-| :------: | :----: | ------------------------------------------------------------- |
-| manifest | JSON | Your JSON file. NOT your path. |
-| options | Object | More details bellow |
-
-**Options**
-
-| Options | Type | Description |
-| :---------: | :-----: | ------------------------------------------------------------------------------------------- |
-| details | boolean | describe errors when they occur |
-| enableState | boolean | result description (e.g. show in console "The JSON file does not correspond to the schema") |
-| fileName | string | file name, practical to validate multiple files via multiple calls |
-
-Imported in source code:
-
-```typescript
-validateManifest(MyjsonManifestFile, { details, enableState, fileName });
+```sh
+pnpm lint
```
-_Cli command don't allow you to use the fileName option._
-_--throwError option is only available on cli._
+Automatically fix code quality problems with
-Using CLI:
+```sh
+pnpm lint:fix
+```
-```bash
-npm run validate *fileOrDirectoryName* --details --enableState --throwError
-```
+---
-
-
-
+[We are hiring, join us! 馃殌](https://www.ledger.com/join-us)
-more infos about the manifest here:
+### See also:
-https://developers.ledger.com/docs/dapp/manifest/
-https://developers.ledger.com/docs/non-dapp/tutorial/2-manifest/
\ No newline at end of file
+- [Ledger Live](https://github.com/LedgerHQ/ledger-live)
diff --git a/packages/simulator/README.md b/packages/simulator/README.md
new file mode 100644
index 00000000..d9efd50a
--- /dev/null
+++ b/packages/simulator/README.md
@@ -0,0 +1,131 @@
+
+
+
WalletAPI Simulator
+ Test and develop your application or service without Ledger Live
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Full documentation
+ 路
+ Report Bug
+ 路
+ Request Feature
+
+
+
+## Overview
+
+The Ledger Wallet Simulator is a comprehensive tool designed to emulate the behavior of a Ledger device simulating responses and interactions with the wallet-API. It aids developers in testing and interacting with Ledger-related applications without requiring a physical Ledger device or necessitating the run of your application inside the WebView of the LedgerLive software. This documentation will guide you through the process of setting up and using the simulator.
+
+By following this documentation, you'll be equipped to install, set up, and make the most out of this simulator. If any issues arise or further customization is needed, consider diving deeper into the source code or consulting the official documentation.
+
+## Table of Contents
+
+- [Ledger Wallet Simulator Documentation](#ledger-wallet-simulator-documentation)
+ - [Overview](#overview)
+ - [Table of Contents](#table-of-contents)
+ - [Installation](#installation)
+ - [Getting Started](#getting-started)
+ - [1. **Setting Up Transport**:](#1-setting-up-transport)
+ - [2. **Creating Client**:](#2-creating-client)
+ - [Working with Profiles](#working-with-profiles)
+ - [Using the Simulator](#using-the-simulator)
+
+---
+
+## Installation
+
+To install the Ledger Wallet Simulator, you'll first need to include the necessary dependencies in your project.
+
+```sh
+npm install @ledgerhq/wallet-api-client
+```
+
+Then, install the simulator package:
+
+```sh
+npm install @ledgerHQ/simulator
+```
+
+---
+
+## Getting Started
+
+### 1. **Setting Up Transport**:
+
+Begin by setting up the transport using the `getSimulatorTransport` function.
+
+```typescript
+import { getSimulatorTransport, profiles } from "@ledgerHQ/simulator";
+
+const transport = getSimulatorTransport(profiles.STANDARD);
+transport.onMessage = handleMessageFunction; // Replace with your message handler.
+```
+
+### 2. **Creating Client**:
+
+Create a `createClient` function that return a new client. The provided simulated transport should be passed to the `WalletAPIClient()` as a parameter to effectively interact with the `WalletAPIClient`. Normally, `WalletAPIClient` only works with real transport, but the simulator provides a simulated transport for this purpose.
+
+Here's a basic form:
+
+```typescript
+function createClient() {
+ // insert the transport created above
+ return new WalletAPIClient(transport);
+}
+```
+
+---
+
+## Working with Profiles
+
+The simulator comes with predefined profiles (`STANDARD` and `DEVICE`), which determine the behavior and data of the simulator. You can easily extend these profiles by spreading inside the profile object:
+
+```typescript
+const extendedProfile = {
+ ...profiles.STANDARD,
+ yourInfo: "yourValue", // Add any custom information here.
+};
+```
+
+---
+
+## Using the Simulator
+
+The primary use case for the simulator is to emulate a Ledger device's behavior for development and testing purposes. Here's a basic example:
+
+```typescript
+// Create a client
+const client = createClient();
+
+// List accounts
+const response = await client.transaction.list();
+
+console.log(response);
+```