@ledgerhq/wallet-api-exchange-module
v0.33.0
Published
Wallet-API Exchange Module for Ledger Live
Maintainers
Keywords
Readme
wallet-api-exchange-module
@ledgerhq/wallet-api-exchange-module is a Wallet API CustomModule that exposes swap, sell, and fund exchange flows to Live Apps running inside Ledger Live. It lets dApps initiate exchange transactions through Ledger Live's built-in exchange service without implementing device signing themselves.
What it does
- Extends
CustomModulefrom@ledgerhq/wallet-api-clientwith exchange-specific RPC methods - Handles the two-phase exchange flow:
start*(get a nonce from the device) →complete*(sign and broadcast) - Supports swap, sell, and fund exchange types
- Provides quote fetching (
getQuotes) and transaction status polling (getTransactionStatus) - Exposes a
customSwapmethod for the device-intent-based swap flow
Key exports / concepts
ExchangeModule— the main class; instantiated with aWalletAPIClientand used by Live AppsstartSwap / startSell / startFund— begin an exchange, returns atransactionIdcompleteSwap / completeSell / completeFund— finalize with signed payload; returnstransactionHashswap— single-call swap using the newercustom.exchange.swapRPCgetQuotes/getTransactionStatus— communicate with the Ledger swap backend via the hostthrowExchangeErrorToLedgerLive— surface exchange errors in the Ledger Live UI
Usage context
Used by Live Apps (dApps embedded in Ledger Live) that need to perform asset exchanges. The Ledger Live host implements the matching RPC handlers; this module is the client-side counterpart bundled with the Live App.
