# Signer interface

Each Signer implements an interface.

### Metadata

## Get Signer metadata

<mark style="color:blue;">`GET`</mark> `https://api-ccmp.bitoftrade.com/metadata`

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "name": "signer_name",
  "availableChains": [1, 56, 137],
  "signer": "0x86f3b7f305f9d02e243a28445a15ecb6eeb12288"
}
```

{% endtab %}
{% endtabs %}

`GET /metadata` the endpoint returns an object with the following type:

```json
{
  "name": "signer_name",
  "availableChains": [1, 56, 137],
  "signer": "0x86f3b7f305f9d02e243a28445a15ecb6eeb12288"
}
```

Where:&#x20;

* `name` is the human-recognizable name of the signer
* `availableChains` is the list of supported chains
* `signer` is the address which is used to sign messages

### Sign event

## Get proof of the event

<mark style="color:green;">`POST`</mark> `https://api-ccmp.bitoftrade.com/sign-event`

#### Request Body

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| chainId<mark style="color:red;">\*</mark> | Number | Chain id of the event         |
| txHash<mark style="color:red;">\*</mark>  | String | Transaction hash of the event |
| abi<mark style="color:red;">\*</mark>     | Object | ABI of the event              |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "chainId": 1,
  "txHash": "0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
  "eventHash": "0x2d734e2f6520ad47f4fbd40ac2f7fa491c029d1b06916be7ba544e2133d16bb5",
  "signature": "0xd189b3df1b889c280f4dc84de5aaaf9aaf425838752ff3ceb13234aae17d12f46375420d93181968ce03d02a5069c2d848a2512113d24004db9001ff889d9fa21c",
  "signer": "0x50fde2a03a1edfd7e1fddeda73d6620a1d0beee3",
  "params": [
    "Transfer",
    1,
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
    "0x974CaA59e49682CdA0AD2bbe82983419A2ECC400",
    "0x59169f3c0e9e3630D0EBa5E5561dC1677D9451F3",
    "1574766820"
  ]
}
```

{% endtab %}
{% endtabs %}

`POST /sign-event` the endpoint which is used to get proof of the event.

This endpoint requires a request body with the following type:&#x20;

```json
{
  "chainId": 1,
  "txHash": "0x0615eacbe66c7547142654509c136119c7a6432b6405264901496fa47009e35e",
  "abi": {
    "name": "string",
    "type": "string",
    "anonymous": true,
    "inputs": [
      {
        "name": "string",
        "type": "string",
        "indexed": true
      }
    ]
  },
  "eventLogIndex": 1
}
```

Where:

* `chainId` and `txHash` are from the transaction that has the `event`,&#x20;
* `abi` is the [ABI](https://docs.soliditylang.org/en/develop/abi-spec.html) of the `event`
* `eventLogIndex` *(optional)* - parameter that specifies the log index for the event. By default, the first event-matched ABI  will be selected.

The response body will have the following type:&#x20;

```json
{
  "chainId": 1,
  "txHash": "0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
  "eventHash": "0x2d734e2f6520ad47f4fbd40ac2f7fa491c029d1b06916be7ba544e2133d16bb5",
  "signature": "0xd189b3df1b889c280f4dc84de5aaaf9aaf425838752ff3ceb13234aae17d12f46375420d93181968ce03d02a5069c2d848a2512113d24004db9001ff889d9fa21c",
  "signer": "0x50fde2a03a1edfd7e1fddeda73d6620a1d0beee3",
  "params": [
    "Transfer",
    1,
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
    "0x974CaA59e49682CdA0AD2bbe82983419A2ECC400",
    "0x59169f3c0e9e3630D0EBa5E5561dC1677D9451F3",
    "1574766820"
  ]
}
```

Where:

* `eventHash`  - [hash](https://docs.bitoftrade.com/for-developers/cross-chain-messaging-protocol/how-it-works/signer-service/event-hash) of the event
* `signature` - is signed eventHash by the `signer`
* `params` - list of the params, `eventId` and `eventArgs`
