Skip to content

A platform app to ease end to end testing of exchange functionalities in the live-app-sdk context

Notifications You must be signed in to change notification settings

LedgerHQ/platform-app-test-exchange

Repository files navigation

platform-app-test-exchange

A Live App allowing to test and debug interactions between the wallet-api exchange related features and the nano app-exchange.

For more information about creating a Live App and integrate it in Ledger Live, head on to our Developer portal.

How it works

The Live App generates and signs locally a protobuf payload, expected by the nano app, using a test partner config signed by a Ledger test key. For it to work with the nano exchange app, you will need to download a specific test version of the nano exchange app, using one of these techniques:

  • by selecting the provider n°10 in ledger live desktop under Settings > Experimental features > Manager provider
  • by building and loading the nano app manually, with the TEST_PUBLIC_KEY flag if you want to use the provided TEST_PRIVATE_KEY
Video demo 🎥
demo.mp4

Getting started

First, run the development server:

npm run dev
# or
yarn dev

For test purposes, you can optionally start the Ledger Live application with the following flags:

  • DISABLE_TRANSACTION_BROADCAST: to prevent transactions for being broadcasted to the network, useful if you just want to test payload generation and signature

  • MOCK_EXCHANGE_TEST_CONFIG: to enable the use of the provided TEST_PRIVATE_KEY, used to sign payloads locally and use the test version of the app exchange. This is useful if you don't have a partner configuration setup with Ledger yet.

Here is an example using these two flags with a Ledger Live build on macOS:

DISABLE_TRANSACTION_BROADCAST=1 MOCK_EXCHANGE_TEST_CONFIG=1 /Volumes/Macintosh\ HD/Applications/Ledger\ Live.app/Contents/MacOS/Ledger\ Live

Copy the following manifest in a manifest.json file.

{
  "id": "test-app",
  "name": "Test",
  "url": "http://localhost:3000",
  "homepageUrl": "",
  "icon": "",
  "platform": "all",
  "apiVersion": "^2.0.0",
  "manifestVersion": "1",
  "branch": "debug",
  "categories": ["tools"],
  "currencies": "*",
  "content": {
    "shortDescription": {
      "en": "Test"
    },
    "description": {
      "en": "Test"
    }
  },
  "permissions": [
    "account.request",
    "currency.list",
    "exchange.start",
    "exchange.complete"
  ],
  "domains": ["http://", "https://"]
}

Add this local manifest in Ledger Live to use this local test live-app in Ledger Live context. For further information, check out the Developer Mode documentation.

Further configuration

A testPayinAddress.json file is located at the root of the directory and is used to reference destination (third service provider) addresses, by cryptocurrency, used for the different flows.

When using this repository locally for your tests, don't hesitate to override any of the default addresses with one that you control.

⚠️ WARNING ⚠️: DO NOT SEND MONEY TO ANY OF THE DEFAULT ADDRESSES PROVIDED IN THIS REPOSITORY. Your money will be lost forever

About

A platform app to ease end to end testing of exchange functionalities in the live-app-sdk context

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •