# Social Growth Protocols

<figure><img src="/files/dTYq5i6HM2Q5TeR8xDFv" alt=""><figcaption></figcaption></figure>

## **`POST /interfa/v2/x2earn`**

Returns a JSON object providing result of recording.

### Query parameters

| Param         | Type    | Required?                  | Description                                                                                     |
| ------------- | ------- | -------------------------- | ----------------------------------------------------------------------------------------------- |
| Authorization | String  | Required                   | [Basic Auth](/layer/api-and-sdk/uxlink-auth/basic-authentication.md)                            |
| address       | String  | Required                   | Wallet Address                                                                                  |
| orderId       | String  | Required                   | Order ID (business number, trade number, etc. should not duplicate)                             |
| amount        | float64 | Required                   | Amount of reward                                                                                |
| tx            | String  | Optional                   | Transaction                                                                                     |
| chainType     | String  | Required when "tx" existed | Chain type. enum(EVM, Non-EVM)                                                                  |
| chainId       | string  | Required when "tx" existed | EVM Chain ID                                                                                    |
| chainName     | String  | Required when "tx" existed | Chain name, specially for Non-EVM chain. enum(x1, eth, sol, arb, base, polygon, scroll, zksync) |
| orderTime     | int64   | Required                   | Order creation timestamp (s)                                                                    |
| orderDesc     | String  | Optional                   | Order description *maxLength: 255*                                                              |

Example：

{% code overflow="wrap" %}

```bash
curl -X POST 'https://exdapps.uxlink.io/interfa/v2/x2earn' \
-H 'Authorization: <Basic Auth>' \
-H 'Content-Type: application/json' \
-d '{
  "address": "0xADDRESS",
  "orderId": "NO22344556678888",
  "amount": 100,
  "tx": "0xtransaction",
  "chainType": "EVM",
  "chainId": "8453",
  "chainName": "base",
  "orderTime": 1717171200,
  "orderDesc": "wonderful deal"
}'
```

{% endcode %}

```json
// Success Response Example:
{
    "success": true,
    "msg": "ok",
    "code": 200,
    "data": {}
}
```

```json
// DuplicateOrderId error Response Example:
{
    "success": false,
    "code": 10101062,
    "msg": "duplicate order id"
}
```

```json
// TotalAmountOverLimit error Response Example:
{
    "success": false,
    "code": 10101001,
    "msg": "total amount over limit"
}
```

## **`POST /interfa/v2/x2earn/summary`**

Returns a JSON object providing total reward amount and limit.

### Query parameters

| Param         | Type   | Required? | Description                                                          |
| ------------- | ------ | --------- | -------------------------------------------------------------------- |
| Authorization | String | Required  | [Basic Auth](/layer/api-and-sdk/uxlink-auth/basic-authentication.md) |

### Response fields

<table><thead><tr><th width="193">Param</th><th width="107">Type</th><th>Description</th></tr></thead><tbody><tr><td>totalAmount</td><td>Decimal</td><td>Return the dapp rewards that have been recorded</td></tr><tr><td>totalAmountMax</td><td>Decimal</td><td>Returns the maximum amount of rewards that the dapp can distribute</td></tr></tbody></table>

Example：

{% code overflow="wrap" %}

```bash
curl -X POST 'https://exdapps.uxlink.io/interfa/v2/x2earn/summary' \
-H 'Authorization: <Basic Auth>' \
-H 'Content-Type: application/json' \
```

{% endcode %}

```json
// Success Response Example:
{
    "success": true,
    "msg": "ok",
    "code": 200,
    "data": {
        "totalAmount": 567000,
        "totalAmountMax": 1000000
    }
}
```

## **`POST /interfa/v2/x2earn/subtotal`**

Returns a JSON object providing subtotal reward amount by address and orderId prefix.

### Query parameters

| Param         | Type   | Required? | Description                                                          |
| ------------- | ------ | --------- | -------------------------------------------------------------------- |
| Authorization | String | Required  | [Basic Auth](/layer/api-and-sdk/uxlink-auth/basic-authentication.md) |
| address       | String | Required  | Wallet Address                                                       |
| orderIdPrefix | String | Optional  | Order ID prefix                                                      |

### Response fields

<table><thead><tr><th width="182">Param</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td>subtotalAmount</td><td>Decimal</td><td>Return address reward amount based on query params</td></tr></tbody></table>

Example：

{% code overflow="wrap" %}

```bash
curl -X POST 'https://exdapps.uxlink.io/interfa/v2/x2earn/subtotal' \
-H 'Authorization: <Basic Auth>' \
-H 'Content-Type: application/json' \
-d '{
  "address": "0xADDRESS",
  "orderIdPrefix": "NO11223445566"
}'
```

{% endcode %}

```json
// Success Response Example:
{
    "success": true,
    "msg": "ok",
    "code": 200,
    "data": {
        "subtotalAmount": 567000
    }
}
```

### Code

| Code    | Desc    | Remarks                           |
| ------- | ------- | --------------------------------- |
| 200     | success | the flag for a successful request |
| 5001002 | false   |                                   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uxlink.io/layer/api-and-sdk/social-growth-protocols.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
