Interface: ISigner
The interface for the Signer class
Methods
getAddress()
getAddress(shardId): Uint8Array
Retrieves the address.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The shard ID. |
Returns
Uint8Array
The address.
Example
const address = signer.getAddress();
Defined
@nilfoundation/niljs/src/signers/types/ISigner.ts:30
getPublicKey()
getPublicKey(): Uint8Array
Retrieves the public key.
Returns
Uint8Array
The public key.
Example
const address = signer.getPublicKey();
Defined
@nilfoundation/niljs/src/signers/types/ISigner.ts:22
sign()
sign(data): Promise<Uint8Array>
Signs the data. Accepts valid data as an argument and returns the signature.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The data to sign. |
Returns
Promise
<Uint8Array
>
The signature.
Example
const data = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const recoveredSignature = signer.sign(data);
Defined
@nilfoundation/niljs/src/signers/types/ISigner.ts:14