coin-modules

Defines rules and layout for blockchain coin module packages in ledger-live.

615|491|Updated Jan 4, 2022
One-click install
npx skills add https://github.com/LedgerHQ/ledger-live --skill coin-modules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coin-modules
Source: https://github.com/LedgerHQ/ledger-live/tree/main/.agents/skills/coin-modules
Command: npx skills add https://github.com/LedgerHQ/ledger-live --skill coin-modules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding or modifying a blockchain integration in the ledger-live monorepo requires following strict package structure, import restrictions, and testing conventions. This Skill encodes those rules so contributors build coin modules that pass linting and integration checks.

Core Features & Use Cases

  • Package Structure Rules: Enforces the standard directory layout (api/, logic/, network/, types/, plus legacy bridge/ and signer/) for packages under libs/coin-modules/coin-<family>.
  • Import Restrictions: Documents which @ledgerhq/* imports are permitted in api/, logic/, and network/ directories, as enforced by eslint no-restricted-imports.
  • Integration Guidance: Explains the preferred Coin Module API path (createApi returning CoinModuleApi) versus the legacy Classic JS Bridge, plus integration test requirements for each API method.
  • Use Case: When adding support for a new blockchain family, follow this Skill to scaffold the package correctly, wire it into genericCoinFrameworkFamilies.json, and write the required integration tests.

Quick Start

Read the coin-modules skill before creating or modifying any package under libs/coin-modules/ to follow the required layout and import rules.

Frequently Asked Questions about coin-modules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new blockchain coin module to ledger-live?

Create a package under libs/coin-modules/coin-<family> named @ledgerhq/coin-<family>, export createApi(config, currencyId) returning a CoinModuleApi, and enable the family in genericCoinFrameworkFamilies.json. Do not create a new module if it fits an existing one's ecosystem.

What directory structure should a coin module package follow?

Use api/ for the Coin Module API surface, logic/ for blockchain logic, network/ for explorer and node communication, and types/ for model definitions. bridge/ and signer/ exist only for legacy implementations.

Which @ledgerhq imports are allowed in coin module api and logic directories?

Only @ledgerhq/logs, @ledgerhq/live-network, @ledgerhq/coin-module-framework, and @ledgerhq/ledger-wallet-framework are permitted in api/, logic/, and network/. This is enforced by eslint no-restricted-imports in libs/coin-modules/.oxlintrc.json.

What integration tests are required for a coin module API?

Cover each transaction type for craftTransaction and estimateFees, each asset type for getBalance and listOperations, and validate metadata against reference blocks, operations, stakes, and validators. lastBlock must return height above zero with a valid date and hash.

Should I use the Classic JS Bridge or the Coin Module API?

Use the Coin Module API path, which is the preferred integration. The Classic JS Bridge using createBridges with currencyBridge and accountBridge is legacy and should not be used for new modules.