Socket
Socket
Sign inDemoInstall

@ledgerhq/coin-evm

Package Overview
Dependencies
602
Maintainers
7
Versions
175
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ledgerhq/coin-evm

Ledger EVM Coin integration


Version published
Weekly downloads
354
decreased by-40.2%
Maintainers
7
Created
Weekly downloads
 

Readme

Source

EVM family integration process

How to integrate a new EVM family currency in the Ledger Live application.

This document will outline the different steps needed to implement a new EVM family currency in the Ledger Live application. Depending on the specifications, some steps might not be needed for all currencies.

Specifications

Most EVM coin integrations are quite similar. The main specs will be outlined below. But each coin may have its specificities and more information can be found on the specific coin integration Jira Epic created for each integration, based on this template https://ledgerhq.atlassian.net/browse/LIVE-10187

  • Integration is done in Ledger Live desktop and Ledger Live mobile
  • Supported features:
    • Sending and receiving coins
    • Viewing transaction history
    • Token support, enabling interactions with the blockchain tokens
  • Use of public RPC node and explorer (etherscan-like). This should be specified in the corresponding Jira Epic
  • The Ethereum embedded app must handle this new network

Live codebase update

Here is an example PR of an EVM currency integration: https://github.com/LedgerHQ/ledger-live/pull/4008

Main steps

Common steps for all new EVM currency integration

  1. Add a new config entry for the new currency under libs/ledgerjs/packages/cryptoassets/src/currencies.ts
  2. Add the new currency ID to the CryptoCurrencyId type under libs/ledgerjs/packages/types-cryptoassets/src/index.ts
  3. Add an entry for the new currency in the abandonSeedAddresses (using the currency ID as key and EVM_DEAD_ADDRESS as value) under libs/ledgerjs/packages/cryptoassets/src/abandonseed.ts
  4. Add the new currency ID to the setSupportedCurrencies function param on each relevant project (CLI, LLD, LLM and LLC test environement)
  5. Add a new feature flag config for this currency:
    1. The new feature flag type in the CurrencyFeatures type under libs/ledgerjs/packages/types-live/src/feature.ts
    2. The new feature flag definition with default value in the CURRENCY_DEFAULT_FEATURES mapping under libs/ledger-live-common/src/featureFlags/defaultFeatures.ts
    3. Use this new feature flag in both LLD and LLM currencies entry points (add account / select crypto flow)
  6. Update related doc and snapshot files:
    1. run pnpm doc under libs/ledgerjs/packages/types-live to update the doc
    2. run pnpm test:jest under apps/ledger-live-desktop to update the snapshots
  7. Add the related currency icon as SVG format under the libs/ui/packages/crypto-icons/src/svg folder within the @ledgerhq/icons-ui package
    1. the file name should follow the {currency_id}.svg naming convention
    2. the SVG icon should follow Ledger Live currency icon guideline (you can use this tool for validation)

Optional steps

Optional / extra steps that might be needed on a case-by-case basis depending on the integration

Tokens support

Here are the steps to handle the new currencies (ERC20) tokens, if relevant:

No change should be needed on Ledger Live side since tokens are automatically imported from CAL at the release stage, cf:

Counter values support (fiat prices)

To have the associated market (fiat) price supported for the network being added, some config updates are needed on the CAL and countervalue service sides.

The process for this can be found here: https://ledgerhq.atlassian.net/wiki/spaces/WALLETCO/pages/4354769042/Adding+price+support+for+a+currency

Ethereum app firmware update

The new network being added needs to be handled by the nano ethereum app.

Make sure the network being added is present under the network_info_t mapping in src_common/network.c (here for staging and here for prod).

In Ledger Live, make sure the ethereum nano app version requirements match the latest version of the ethereum app handling the network being added:

Tests

Bot

  • Make sure to fund the appropriate bot(s) with coins and tokens of the new network being added (cf. The different bots)
  • Make sure to make the bot run multiple times on your PR to make sure everything works fine with the new network
  • If the coin related to the network you are adding is somewhat expensive, you can tailor the minimum balance needed to test this coin by updating minBalancePerCurrencyId under libs/coin-evm/src/specs.ts

Manual testing

The bare minimum to test in terms of flows is, on both LLD and LLM:

  • Add account
  • Send funds (coins) from one account to another
  • Add (receive) token (if supported)
  • Send token (if supported)

Firebase Feature Flag config

Make sure to add the newly created currency feature flag to the Firebase config

Keywords

FAQs

Last updated on 18 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc