diff --git a/packages/client/README.md b/packages/client/README.md index e69a44e1..11ef7d2d 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -1,6 +1,6 @@

Ledger -

WalletAPI Client SDK

+

WalletAPI Client

Integrate your application or service inside Ledger Live

@@ -12,7 +12,7 @@ License - Tests Passing + Tests Passing diff --git a/packages/simulator/README.md b/packages/simulator/README.md index 1193f9e2..c914bca9 100644 --- a/packages/simulator/README.md +++ b/packages/simulator/README.md @@ -1,4 +1,43 @@ -# Ledger Wallet Simulator Documentation +

+ Ledger +

WalletAPI Simulator

+

Test and develop your application or service without Ledger Live

+

+

+

+ + + + + License + + + Tests Passing + + + + + + Issues + + + GitHub pull requests + + + Discord + + + +

+ +

+ Full documentation + · + Report Bug + · + Request Feature +

+

## Overview @@ -6,8 +45,8 @@ The Ledger Wallet Simulator is a comprehensive tool designed to emulate the beha 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) @@ -16,9 +55,7 @@ By following this documentation, you'll be equipped to install, set up, and make - [1. **Setting Up Transport**:](#1-setting-up-transport) - [2. **Creating Client**:](#2-creating-client) - [Working with Profiles](#working-with-profiles) - - [Custom Handlers (Optional)](#custom-handlers-optional) - [Using the Simulator](#using-the-simulator) - - [Transactions Example](#transactions-example) --- @@ -41,6 +78,7 @@ npm install @ledgerHQ/simulator ## Getting Started ### 1. **Setting Up Transport**: + Begin by setting up the transport using the `getSimulatorTransport` function. ```typescript @@ -51,13 +89,14 @@ transport.onMessage = handleMessageFunction; // Replace with your message handle ``` ### 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. + +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 + // insert the transport created above return new WalletAPIClient(transport); } ``` @@ -71,21 +110,10 @@ The simulator comes with predefined profiles (`STANDARD` and `DEVICE`), which de ```typescript const extendedProfile = { ...profiles.STANDARD, - yourInfo: "yourValue" // Add any custom information here. + yourInfo: "yourValue", // Add any custom information here. }; ``` ---- - -## Custom Handlers (Optional) - -If you wish to introduce custom behaviors into the simulator, you can define and use custom handlers. These handlers enable additional functionalities, allowing for a broader range of testing scenarios. - - **Logging**: Logs a message and expects a `{ res: "hello" }` response. - - **Device Handling**: Opens a device with a specific ID. - - --- ## Using the Simulator @@ -101,7 +129,3 @@ const response = await client.transaction.list(); console.log(response); ``` - ---- - -## Transactions Example