GithubHelp home page GithubHelp logo

isabella232 / platform-app-test-exchange Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ledgerhq/platform-app-test-exchange

0.0 0.0 0.0 87 KB

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

JavaScript 62.73% TypeScript 33.63% CSS 3.64%

platform-app-test-exchange's Introduction

platform-app-test-exchange

A Live App allowing to test and debug interactions between the live-app-sdk 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°7 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 optionaly start the Ledger Live application with the following flags:

  • DISABLE_TRANSACTION_BROADCAST: to prevent transactions for being broadcasted to the network, usefull 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 usefull 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": "0.0.1",
  "manifestVersion": "1",
  "branch": "debug",
  "categories": ["tools"],
  "currencies": "*",
  "content": {
    "shortDescription": {
      "en": "Test"
    },
    "description": {
      "en": "Test"
    }
  },
  "permissions": [
    {
      "method": "*"
    }
  ],
  "domains": ["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

platform-app-test-exchange's People

Contributors

chabroa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.