interface · Browser and Node

# Signer

`@toip-tools/eventlog` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/eventlog/src/keys.ts#L21)

Import:

```ts
import { type Signer } from "@toip-tools/eventlog";
```

## Declaration

interface:

```ts
interface Signer {
  /** Defaults to Ed25519 when absent. */
  readonly curve?: Curve;
  /** 32 bytes for Ed25519; 33 bytes (compressed point) for P-256. */
  readonly publicKey: Uint8Array;
  sign(message: Uint8Array): Promise<Uint8Array | WrappedSignature>;
}
```

## Properties

**`curve` (optional · readonly)**

`Curve | undefined`

Defaults to Ed25519 when absent.

**`publicKey` (required · readonly)**

`Uint8Array<ArrayBufferLike>`

32 bytes for Ed25519; 33 bytes (compressed point) for P-256.

## Methods

### `sign`

Signature:

```ts
sign(message: Uint8Array): Promise<Uint8Array | WrappedSignature>;
```

#### Parameters

- **`message` (required)**: `Uint8Array<ArrayBufferLike>`

#### Returns

`Promise<Uint8Array<ArrayBufferLike> | WrappedSignature>`

[Usage guide](https://toip.tools/toolkit/eventlog/#usage) · [Error handling](https://toip.tools/toolkit/eventlog/#errors) · [All exports](https://toip.tools/toolkit/eventlog/api/)

---

This is the Markdown version of https://toip.tools/toolkit/eventlog/api/Signer/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
