asyncapi: "2.6.0"
info:
  title: Blockchain Watcher API
  version: "0.0.1"
  description: |
    Platform service that allows to extract, transform and load data from different blockchains platforms.
servers:
  staging-testnet:
    url: notification-chain-events-dev-testnet.fifo
    protocol: sns
  staging-mainnet:
    url: notification-chain-events-dev-mainnet.fifo
    protocol: sns
  prod-testnet:
    url: notification-chain-events-prod-testnet.fifo
    protocol: sns
  prod-mainnet:
    url: notification-chain-events-prod-mainnet.fifo
    protocol: sns
defaultContentType: application/json
channels:
  LogMessagePublished:
    description: Wormhole core contract emitted event
    subscribe:
      message:
        $ref: "#/components/messages/logMessagePublished"
  EvmTransactionFound:
    description: Token bridge emitted event
    subscribe:
      message:
        $ref: "#/components/messages/evmTransactionFound"
components:
  messages:
    logMessagePublished:
      name: LogMessagePublished
      title: LogMessagePublished
      contentType: application/json
      payload:
        $ref: "#/components/schemas/logMessagePublished"
    evmTransactionFound:
      name: EvmTransactionFound
      title: EvmTransactionFound
      contentType: application/json
      payload:
        $ref: "#/components/schemas/evmTransactionFound"
      examples:
        - name: EvmTransactionFound from Ethereum
          payload:
            name: "evm-transaction-found"
            address: "wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb"
            chainId: 1
            txHash: "3FySmshUgVCM2N158oNYbeTfZt2typEU32c9ZxdAXiXURFHuTmeJHhc7cSUtqHdwAsbVWWvEsEddWNAKzkjVPSg2"
            blockHeight: 234015120
            blockTime: 1701724272
            attributes:
              blockHash: "0x1359819238ea89f49c20e42eb5603bf0541589d838d971984b60c7cdb391d9c2"
              blockNumber: 0x11ec2bc
              from: 0xfb070adcd21361a3946a0584dc84a7b89faa68e3
              gas: 0x14485
              gasPrice: xfc518561e
              input: "0x9981509f000000000000"
              maxFeePerGas: 0x1610f75b9a
              maxPriorityFeePerGas: 0x5f5e100
              methodsByAddress: MethodCompleteTransfer
              name: transfer-redeemed
              nonce: 0x1
              r: 0xf5794b0970386d73b693b17f147fae0427db278e951e45465ac2c9835537e5a9
              s: 0x6dccc8cfee216bc43a9d66525fa94905da234ad32d6cc3220845bef78f25dd42
              status: 0x1
              timestamp: 1702663079
              to: 0x3ee18b2214aff97000d974cf647e7c347e8fa585
              transactionIndex: 0x6f
              type: 0x2
              v: 0x1
              value: 0x5b09cd3e5e90000
  schemas:
    base:
      type: object
      properties:
        trackId:
          type: string
        source:
          type: string
        event:
          type: string
        version:
          type: number
        timestamp:
          $ref: "#/components/schemas/sentAt"
    chainEventBase:
      type: object
      properties:
        chainId:
          type: number
        emitter:
          type: string
        txHash:
          type: string
        blockHeight:
          type: number
        blockTime:
          $ref: "#/components/schemas/sentAt"
    logMessagePublished:
      allOf:
        - $ref: "#/components/schemas/base"
      type: object
      properties:
        data:
          allOf:
            - $ref: "#/components/schemas/chainEventBase"
          type: object
          properties:
            attributes:
              type: object
              properties:
                sender:
                  type: string
                sequence:
                  type: number
                nonce:
                  type: number
                payload:
                  type: string
                consistencyLevel:
                  type: number
    evmTransactionFound:
      allOf:
        - $ref: "#/components/schemas/base"
      type: object
      properties:
        data:
          type: object
          allOf:
            - $ref: "#/components/schemas/chainEventBase"
          properties:
            attributes:
              type: object
              properties:
                name:
                  type: string
                from:
                  type: string
                to:
                  type: string
                status:
                  type: string
                blockNumber:
                  type: number
                input:
                  type: string
                methodsByAddress:
                  type: string
                timestamp:
                  type: number
                blockHash:
                  type: string
                gas:
                  type: string
                gasPrice:
                  type: string
                maxFeePerGas:
                  type: string
                maxPriorityFeePerGas:
                  type: string
                nonce:
                  type: string
                r:
                  type: string
                s:
                  type: string
                transactionIndex:
                  type: string
                type:
                  type: string
                v:
                  type: string
                value:
                  type: string
    sentAt:
      type: string
      format: date-time
      description: Date and time when the message was sent.
