Signer interface
Each Signer implements an interface.
Metadata
Get Signer metadata
GET
https://api-ccmp.bitoftrade.com/metadata
{
"name": "signer_name",
"availableChains": [1, 56, 137],
"signer": "0x86f3b7f305f9d02e243a28445a15ecb6eeb12288"
}
GET /metadata
the endpoint returns an object with the following type:
{
"name": "signer_name",
"availableChains": [1, 56, 137],
"signer": "0x86f3b7f305f9d02e243a28445a15ecb6eeb12288"
}
Where:
name
is the human-recognizable name of the signeravailableChains
is the list of supported chainssigner
is the address which is used to sign messages
Sign event
Get proof of the event
POST
https://api-ccmp.bitoftrade.com/sign-event
Request Body
chainId*
Number
Chain id of the event
txHash*
String
Transaction hash of the event
abi*
Object
ABI of the event
{
"chainId": 1,
"txHash": "0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
"eventHash": "0x2d734e2f6520ad47f4fbd40ac2f7fa491c029d1b06916be7ba544e2133d16bb5",
"signature": "0xd189b3df1b889c280f4dc84de5aaaf9aaf425838752ff3ceb13234aae17d12f46375420d93181968ce03d02a5069c2d848a2512113d24004db9001ff889d9fa21c",
"signer": "0x50fde2a03a1edfd7e1fddeda73d6620a1d0beee3",
"params": [
"Transfer",
1,
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
"0x974CaA59e49682CdA0AD2bbe82983419A2ECC400",
"0x59169f3c0e9e3630D0EBa5E5561dC1677D9451F3",
"1574766820"
]
}
POST /sign-event
the endpoint which is used to get proof of the event.
This endpoint requires a request body with the following type:
{
"chainId": 1,
"txHash": "0x0615eacbe66c7547142654509c136119c7a6432b6405264901496fa47009e35e",
"abi": {
"name": "string",
"type": "string",
"anonymous": true,
"inputs": [
{
"name": "string",
"type": "string",
"indexed": true
}
]
},
"eventLogIndex": 1
}
Where:
chainId
andtxHash
are from the transaction that has theevent
,abi
is the ABI of theevent
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:
{
"chainId": 1,
"txHash": "0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
"eventHash": "0x2d734e2f6520ad47f4fbd40ac2f7fa491c029d1b06916be7ba544e2133d16bb5",
"signature": "0xd189b3df1b889c280f4dc84de5aaaf9aaf425838752ff3ceb13234aae17d12f46375420d93181968ce03d02a5069c2d848a2512113d24004db9001ff889d9fa21c",
"signer": "0x50fde2a03a1edfd7e1fddeda73d6620a1d0beee3",
"params": [
"Transfer",
1,
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"0xa3b1123b8181f27c30f9cae42340325f0fcecf80c7886045dc159a8b8abd9a63",
"0x974CaA59e49682CdA0AD2bbe82983419A2ECC400",
"0x59169f3c0e9e3630D0EBa5E5561dC1677D9451F3",
"1574766820"
]
}
Where:
eventHash
- hash of the eventsignature
- is signed eventHash by thesigner
params
- list of the params,eventId
andeventArgs
Last updated