bitoftrade docs
  • 👋Welcome to the bitoftrade docs!
  • 🤖bitoftrade intro
  • 📨Contact Us
  • For traders
    • ✅Cross-Chain Swaps
      • How it works
        • Liquidity providers & validators
        • Security
      • User Guide
    • 🔄Trading platform
      • Features
        • Leverage trading
        • Token swaps
        • Buy crypto with fiat
        • Market screener
      • Quick start
        • How do I swap tokens on bitoftrade?
        • How to buy crypto with fiat?
        • How to trade with leverage on bitoftrade?
        • How to use the Markets page?
        • How to place limit order?
      • Fees
      • FAQ
  • For businesses
    • 🛒AllPay Widget
      • Use cases
        • Token Owners
        • Personal Exchange
        • Creators
        • GameFi, Metaverse
        • Crypto Payments (soon)
      • Quick start
        • Customization Panel
        • Swap and Sale Integration
        • NFT Widget Integration
          • NFT Listing
          • Code Integration
      • FAQ
  • For developers
    • 🔀Cross-Chain Messaging Protocol
      • How it works
        • Signer Service
          • Event Hash
          • Signer interface
        • Signers Registry Contract
      • Quick start
        • Emit event
        • Verify event
        • Receive event
      • Smart contracts
      • Advanced
        • Threshold Signature
        • Hosted TSS signer
      • Security
      • FAQ
  • Guides
    • 📚General
      • How to download and connect MetaMask for desktop?
      • How do I download and connect MetaMask for mobile?
      • How do I import ERC20 tokens to MetaMask?
      • How do I manage my funds in a volatile market?
      • How to invest in cryptocurrency
    • ⛓️Polygon
      • How to swap on the Polygon network
      • How to bridge my Polygon tokens
      • How to add Polygon to my MetaMask
    • ⛓️Binance Smart Chain
      • How to bridge my BSC tokens
      • How to swap on the BSC network
      • How to add BSC to my MetaMask
    • ⛓️Fantom
      • How to bridge my Fantom tokens
      • How to swap on the Fantom network
      • How to add Fantom to my MetaMask
    • ⛓️Avalanche
      • How to bridge my Avalanche tokens
      • How to swap on the Avalanche network
      • How to add Avalanche to my MetaMask
Powered by GitBook
On this page
  • Metadata
  • Get Signer metadata
  • Sign event
  • Get proof of the event
  1. For developers
  2. Cross-Chain Messaging Protocol
  3. How it works
  4. Signer Service

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 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

POST https://api-ccmp.bitoftrade.com/sign-event

Request Body

Name
Type
Description

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 and txHash are from the transaction that has 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:

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

Where:

  • signature - is signed eventHash by the signer

  • params - list of the params, eventId and eventArgs

PreviousEvent HashNextSigners Registry Contract

Last updated 2 years ago

abi is the of the event

eventHash - of the event

🔀
ABI
hash