> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streambird.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Solana Sign Message

> Sign a message using a managed wallet. Managed wallet means the private key is never exposed to the client and always stored encrypted in our vault.

<Snippet file="authorization.mdx" />

## Path Parameters

<ParamField path="wallet_id" type="string" required>
  Unique wallet ID of the wallet used to sign the message.
</ParamField>

## Request Body

<ParamField body="method" type="string" required>
  Must be `sol_signMessage`.
</ParamField>

<ParamField body="params" type="object" required>
  Parameters for the RPC call.

  <Expandable title="params">
    <ParamField body="message" type="string" required>
      Message to be signed.
    </ParamField>

    <ParamField body="encoding" type="string">
      Encoding of the input message. Possible values: `utf-8`, `base58`, `base64`. If not provided, the message is treated as plaintext (`utf-8`).
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="method" type="string">
  RPC method that was executed (`sol_signMessage`).
</ResponseField>

<ResponseField name="data" type="object">
  Signed message data.

  <Expandable title="data">
    <ResponseField name="signature" type="string">
      Signature of the message.
    </ResponseField>

    <ResponseField name="encoding" type="string">
      Encoding of the returned signature. If request `encoding` is not provided, the response encoding is `base58`.
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  * If `encoding` is omitted, the message is interpreted as plaintext (`utf-8`).
  * If `encoding` is omitted, the response encoding defaults to `base58`.
  * If `encoding` is provided, the response uses the same encoding as the request but will be `base64` or `base58`.
  * No private key material is ever exposed or returned.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.moonkey.fun/v1/wallets/wallet_35ptpWOqO2SnacamII91ecIzmKT/rpc \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "method": "sol_signMessage",
      "params": {
        "message": "test"
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "method": "sol_signMessage",
    "data": {
      "signature": "53qEX5SmUJkmvLjTMvi45M4otThvZfd4QJiXa998eRJBqxGuvg9tHTqYCaBtvfLd4VRbpes5ukPNsrdC1Yz7ZMeU",
      "encoding": "base58"
    }
  }
  ```
</ResponseExample>
