Coder Social home page Coder Social logo

app-exchange's Introduction

Exchange app for the Ledger Nano S and Ledger Nano X

Introduction

This app is the orchestrator of Swap and Sell functionalities on ledger devices. An overview of the feature is available here

Building and installing

To build and install the app on your Nano S or X you must set up the Ledger Nano S or X build environments. Please follow the Getting Started instructions at the Ledger Nano S github repository.

The command to compile and load the app onto the device is:

make load

To remove the app from the device do:

make delete

Testing

The ./test directory contains files for testing the app and its interactions with other apps. It does not contain the binaries used to test the app. The binaries need to be generated and put in test/elfs/ before launching the tests.

The exchange binaries need to be generated with the following flags.

make TESTING=1 TEST_PUBLIC_KEY=1

Then the application must be placed in the test/elfs/ directory, under the name exchange_nanos.elf, exchange_nanox.elf, or exchange_nanosp.elf depending on the SDK:

// Choose one
// cp bin/app.elf test/elfs/exchange_nanos.elf
// cp bin/app.elf test/elfs/exchange_nanox.elf
// cp bin/app.elf test/elfs/exchange_nanosp.elf

The sideloaded applications binaries need to be generated in their respective repositories and placed in the test/elfs/ directory. For the entire test collection to pass, the following binaries must be present

bitcoin_nanos.elf
bitcoin_nanosp.elf
bitcoin_nanox.elf
ethereum_nanos.elf
ethereum_nanosp.elf
ethereum_nanosp.elf
ethereum_nanox.elf
litecoin_nanos.elf
litecoin_nanosp.elf
litecoin_nanox.elf
stellar_nanos.elf
stellar_nanosp.elf
stellar_nanox.elf
tezos_nanos.elf
tezos_nanosp.elf
tezos_nanox.elf
xrp_nanos.elf
xrp_nanosp.elf
xrp_nanox.elf

To run the tests:

cd test
yarn install
yarn test

app-exchange's People

Contributors

agrojean-ledger avatar apaillier-ledger avatar bigspider avatar dependabot[bot] avatar fbeutin-ledger avatar greenknot avatar grydz avatar jibeee avatar lpascal-ledger avatar pscott avatar saltari avatar tamtamhero avatar teams2ua avatar xchapron-ledger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-exchange's Issues

Dependency gloom

Ledgerwallet comes with click>=7.0. It seems to be installed first, so pip installs click==7.0.
Speculos asks for flask>=2.0, pip installs flask==2.2.2 which needs clicks>=8.0. It is installed after, but pip does not see any issue and does not upgrade click.

So when ragger runs in tests, it fails with an error:

ImportError while loading conftest '/home/runner/work/app-exchange/app-exchange/test/python/conftest.py'.
test/python/conftest.py:7: in <module>
    from ragger.backend import SpeculosBackend, LedgerCommBackend, LedgerWalletBackend
../../../.local/lib/python3.8/site-packages/ragger/backend/__init__.py:17: in <module>
    from .speculos import SpeculosBackend
../../../.local/lib/python3.8/site-packages/ragger/backend/speculos.py:20: in <module>
    from speculos.client import SpeculosClient, ApduResponse, ApduException
../../../.local/lib/python3.8/site-packages/speculos/__init__.py:1: in <module>
    from . import api  # noqa: F401
../../../.local/lib/python3.8/site-packages/speculos/api/__init__.py:1: in <module>
    from .api import ApiRunner  # noqa: F401
../../../.local/lib/python3.8/site-packages/speculos/api/api.py:[5](https://github.com/LedgerHQ/app-exchange/runs/7761102319?check_suite_focus=true#step:7:6): in <module>
    from flask import Flask
../../../.local/lib/python3.[8](https://github.com/LedgerHQ/app-exchange/runs/7761102319?check_suite_focus=true#step:7:9)/site-packages/flask/__init__.py:5: in <module>
    from .app import Flask as Flask
../../../.local/lib/python3.8/site-packages/flask/app.py:34: in <module>
    from . import cli
../../../.local/lib/python3.8/site-packages/flask/cli.py:[15](https://github.com/LedgerHQ/app-exchange/runs/7761102319?check_suite_focus=true#step:7:16): in <module>
    from click.core import ParameterSource
E   ImportError: cannot import name 'ParameterSource' from 'click.core' (/usr/lib/python3/dist-packages/click/core.py)

Not sure why this triggers now and not before.

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.