Storage and Schema

Engagement Structure Defintion

Definition in Go Struct

type Engagement struct {
    Data struct{
      Operation  string `json:"operation"`
      Target     string `json:"target,omitempty"`
      TargetType string `json:"target_type,omitempty"`
      Content    interface `json:"content,omitempty"`
    } `json:"data"`
    SecondaryKey       string `json:"secondary_key,omitempty"`
    Address            string `json:"address"`
    AddressType        string `json:"address_type"`
    SecondarySignature string `json:"secondary_signature"`
    Provider           string `json:"provider"`
    Version            string `json:"version"`
}

Parameter Definition

Parameter
Definition
Note

operation

The type of engagement

These values are supported right now: create, follow, like, dislike, comment

target

The target of this operation.

For example, when operation is "follow", the target is the user addres, when operation is "comment", the target is the txid of the content.

target_type

The ID format of the target.

Right now, "evm", "ar_tx_hash" are supported

content

Based on different operations, it holds different information

secondary_key

The signing secondary key

address

The address of the user

address_type

The type of address

Right now, "evm" is supported

secondary_signature

The signature of this data block signed by secondary_key

provider

The SDK or software which generates this data block

version

The version of SDK

Example

create

{
  "data": {
    "operation": "create",
    "target_type": "ar_tx_hash",
    "content": {
      "language_type": "en",
      "publish_time": 1669536553,
      "title": "title",
      "content": "content"
    }
  },
  "secondary_key": "0x89a04eb167a482659f1b8e0e8c597f69f5b1d4e96652feccf4b01710a45ac6c8",
  "address": "0xF2FCeCEacA2bDC9781fe920Af9Cdc20dB2cea00D",
  "address_type": "evm address",
  "secondary_signature": "0x8778ce9cb1f1ac39627b3effdda0ae48e66e185528ea17825863fb0e710420f8eeecea468e98e7e6f32d93c03a4f12719de578fd86dbf07cb925f0b79023ac01",
  "provider": "readon.me",
  "version": "1.0.01.beta"
}

follow

{
  "data": {
    "operation": "follow",
    "target": "0x5F5Df3C0AD7579D91127BDC2d112a86273d28fC3",
    "target_type": "evm"
  },
  "secondary_key": "0x89a04eb167a482659f1b8e0e8c597f69f5b1d4e96652feccf4b01710a45ac6c8",
  "address": "0xF2FCeCEacA2bDC9781fe920Af9Cdc20dB2cea00D",
  "address_type": "evm address",
  "secondary_signature": "0xb0c9d00a1417ef6ffc3885e43d98611a5845d59fceddabab4dc4586bd85500f3e2791b83c5a8282a3ebaa9f937c881e0e28037a84061ffe5c6a86db639a3f008",
  "provider": "readon.me",
  "version": "1.0.01.beta"
}

like

{
  "data": {
    "operation": "like",
    "target": "--Qq0ZpzQenKZAGMebqdvRAL2u1POvRUkh_MzauWxww",
    "target_type": "ar_tx_hash"
  },
  "secondary_key": "0x89a04eb167a482659f1b8e0e8c597f69f5b1d4e96652feccf4b01710a45ac6c8",
  "address": "0xF2FCeCEacA2bDC9781fe920Af9Cdc20dB2cea00D",
  "address_type": "evm address",
  "secondary_signature": "0x5f41dcb2532dc063ece3a9eef2aa89730f5e14e6af3cfa0a91e42371800f58e70442fbe8f8f2bbccdd6c1dc81fd064e0fdab385c35e84e7930b7ec16ff9abb0f",
  "provider": "readon.me",
  "version": "1.0.01.beta"
}

comment

{
  "data": {
    "operation": "comment",
    "target": "--Qq0ZpzQenKZAGMebqdvRAL2u1POvRUkh_MzauWxww",
    "target_type": "ar_tx_hash",
    "content": {
      "language_type": "en",
      "publish_time": 1669536554,
      "content": "comment content"
    }
  },
  "secondary_key": "0x89a04eb167a482659f1b8e0e8c597f69f5b1d4e96652feccf4b01710a45ac6c8",
  "address": "0xF2FCeCEacA2bDC9781fe920Af9Cdc20dB2cea00D",
  "address_type": "evm address",
  "secondary_signature": "0xb9722091ab506fadcfb1f82bdab381110153a0e180f2f63a7791041fd946699cab1d09747ef14264b8eb709ff619ae1dab7d79ce99d1308e0b5785f12985dd03",
  "provider": "readon.me",
  "version": "1.0.01.beta"
}

Last updated