@sei-js/ledger
TypeScript library for SEI Ledger app helper functions
Overview
The @sei-js/ledger
package provides TypeScript helper functions for integrating with the SEI Ledger hardware wallet app. It enables secure transaction signing and address derivation for Sei blockchain applications using Ledger devices.
Installation
Core Functions
createTransportAndApp
Creates a transport connection and app instance for communicating with the Ledger device.
Parameters:
- None
Returns:
Promise<{transport: Transport, app: SeiApp}>
- Object containing transport and app instances
getAddresses
Retrieves both EVM and Cosmos addresses from the Ledger device for a given derivation path.
Parameters:
app
(SeiApp) - An instance of the Ledger Sei apppath
(string) - HD derivation path (e.g., “m/44’/60’/0’/0/0”)
Returns:
Promise<{evmAddress: string, nativeAddress: string}>
- Object containing both address types
SeiLedgerOfflineAminoSigner
A signer class that enables offline amino signing with Ledger devices, compatible with CosmJS.
Constructor
Parameters:
app
(SeiApp) - An instance of the Ledger Sei apppath
(string) - HD derivation path (e.g., “m/44’/60’/0’/0/0”)
getAccounts
Retrieves account information from the Ledger device.
Returns:
Promise<readonly AccountData[]>
- Array of AccountData objects with address and public key
signAmino
Signs a transaction document using the Ledger device.
Parameters:
_signerAddress
(string) - The address of the signer (unused)signDoc
(StdSignDoc) - The sign document to be signed
Returns:
Promise<AminoSignResponse>
- Object containing the signed document and signature
Complete Example
Here’s a complete example showing how to use the ledger package to delegate tokens:
Security Notes
- Ensure your Ledger device is genuine and purchased from official sources
- Always verify transaction details on your Ledger device screen before confirming
- Keep your Ledger device firmware updated
- Store your recovery phrase securely and never share it
Hardware Requirements
- Ledger Nano S Plus, Nano X, or compatible device
- SEI app installed on the Ledger device
- USB or Bluetooth connection to your computer