# signMessage

> Overview of the signMessage function

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function signMessage(client, params): Promise<`0x${string}`>;
```

Defined in: [packages/wallet-apis/src/actions/signMessage.ts:36](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/wallet-apis/src/actions/signMessage.ts#L36)

Signs a message using the smart account.
This method requests the account associated with the signer and uses it to sign the message.

## Example

```ts
// Sign a simple text message
const signature = await client.signMessage("Hello, world!");

// Sign a raw hex message
const signature = await client.signMessage({
  raw: "0x48656c6c6f2c20776f726c6421",
});
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `client`
      </td>

      <td>
        `InnerWalletApiClient`
      </td>

      <td>
        The wallet API client to use for the request
      </td>
    </tr>

    <tr>
      <td>
        `params`
      </td>

      <td>
        [`SignMessageParams`](../type-aliases/SignMessageParams)
      </td>

      <td>
        Parameters for signing the message
      </td>
    </tr>

  </tbody>
</table>

## Returns

`Promise`\<`` `0x${string}` ``>

A Promise that resolves to the signed message as a hex string