# verifyMessage

Returns whether the provided signature data matches the provided message and was signed by the account of the provided public key.

## **Input Arguments**

<table><thead><tr><th width="282">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>message: string</code></td><td>Salt prefix + original message</td></tr><tr><td><code>data: string</code></td><td>Signed message</td></tr><tr><td><code>publicKey: string</code></td><td>Public key of account that signed message</td></tr></tbody></table>

## **Success Response**

<table><thead><tr><th width="284">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>result: boolean</code></td><td>Whether the provided signature matches the provided message and public key</td></tr></tbody></table>

## **Error Response**

<table><thead><tr><th width="290">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>type: string</code></td><td>The type of error which has occured</td></tr><tr><td><code>description: string</code></td><td>A description of the error which has occured</td></tr><tr><td><code>data: string</code></td><td>Any raw data associated with the error</td></tr></tbody></table>

## Example

### Request

```js
neoline.verifyMessage({
  message: 'Hello world',
  data: 'be506bf7e6851960bfe45968bf5dbbf79a9dc5dc63ee5b88629acfb288c435649c2766e977d4bc76253d8590bb3ca3d9b70efd71d6f7eebdf060dfa58c6601fd',
  publicKey: '03ba9524bd7479414be713c3a4f6f3ef35f90bb4b08f0f552211bf734c24415230'
})
.then(result => {
  console.log('Signature data matches provided message and public key: ' + JSON.stringify(result));
})
.catch((error) => {
  const {type, description, data} = error;
  switch(type) {
    case 'NO_PROVIDER':
        console.log('No provider available.');
        break;
    case 'CONNECTION_DENIED':
        console.log('The user rejected the request to connect with your dApp');
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});
```

### Response

```js
{
  result: true
}
```
