Class: LocalECDSAKeySigner
LocalKeySigner is a class that allows for signing data with the private key. It uses the secp256k1 curve implementation by the @noble/curves/secp256k1 library.
Example
import {
  LocalECDSAKeySigner,
  generateRandomPrivateKey,
} from '@nilfoundation/niljs';
const signer = new LocalECDSAKeySigner({
  privateKey: generateRandomPrivateKey(),
});
Implements
Constructors
new LocalECDSAKeySigner()
new LocalECDSAKeySigner(config): LocalECDSAKeySigner
Creates an instance of LocalECDSAKeySigner.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| 
 | The config for the LocalECDSAKeySigner. See ILocalKeySignerConfig. | 
Returns
Defined in
nil/nil.js/src/signers/LocalECDSAKeySigner.ts:54
Methods
getAddress()
getAddress(shardId): Promise<Uint8Array>
Retrieves the wallet address.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| 
 | 
 | The ID of the shard where the wallet is deployed. | 
Returns
Promise<Uint8Array>
The wallet address.
Implementation of
Async
Defined in
nil/nil.js/src/signers/LocalECDSAKeySigner.ts:116
getPublicKey()
getPublicKey(): Promise<Uint8Array>
Retrieves the public key.
Returns
Promise<Uint8Array>
The publc key of the signer.
Implementation of
Async
Defined in
nil/nil.js/src/signers/LocalECDSAKeySigner.ts:97
sign()
sign(data): Promise<Uint8Array>
Signs the data.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| 
 | 
 | The input data. | 
Returns
Promise<Uint8Array>
The signed data.