Use a signer
ℹ️
We will show the usage of the signer with the Ethereum signer. The same logic can be applied to the other signers.
Installation
⚠️
This module is not standalone; it depends on the @ledgerhq/device-management-kit package, so you need to install it first.
To install the device-signer-kit-ethereum
package, run the following command:
npm install @ledgerhq/device-signer-kit-ethereum
Usage
To initialize an Ethereum signer instance, you need a Ledger Device Management Kit instance and the ID of the session of the connected device. Use the SignerEthBuilder
along with the Context Module by default developed by Ledger:
// Initialize an Ethereum signer instance using default context module
const signerEth = new SignerEthBuilder({ sdk, sessionId }).build();
You can also configure the context module yourself:
// Initialize an Ethereum signer instance using customized context module
const signerEth = new SignerEthBuilder({ sdk, sessionId })
.withContextModule(customContextModule)
.build();
Reference
Find the signers features in the references section:
- Ethereum signer
- More signers to come…