Skip to main content

Interface: ISigner

The interface for the Signer class

Methods

getAddress()

getAddress(params): Promise<Uint8Array>

Retrieves the address.

Parameters

ParameterType

params

unknown

Returns

Promise<Uint8Array>

The address.

Example

const address = signer.getAddress();

Defined

@nilfoundation/niljs/src/signers/types/ISigner.ts:29


getPublicKey()

getPublicKey(params): Promise<Uint8Array>

Retrieves the public key.

Parameters

ParameterType

params

unknown

Returns

Promise<Uint8Array>

The public key.

Example

const address = signer.getPublicKey();

Defined

@nilfoundation/niljs/src/signers/types/ISigner.ts:21


sign()

sign(data): Promise<Uint8Array>

Signs the data. Accepts valid data as an argument and returns the signature.

Parameters

ParameterTypeDescription

data

Uint8Array

The data to sign.

Returns

Promise<Uint8Array>

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:13