Ingestion API

Ingestion API

1. Initiating a Transaction

POST /uxlink/account/v1/transactions

Request Parameters:

Parameter
Type
Required
Description

executeData

Object

Required

Data to be executed, including contract address, execution method, and parameters

Request Body Example:

executeData: {
  to: "0x.....", // Address of the business contract to be called
  data: "...", // Encoded string containing the function name to be executed in the contract and the arguments passed to this function. Method for creating executeData will be provided below.
},

Response:

{
    "success": true,
    "msg": "ok",
    "code": 200,
    "data": {
        "orderId": "1233", // ID of this transaction, which can be used to query the transaction result.
    }
}

2. Querying Transaction Result

POST /uxlink/account/v1/transactions/query

Request Parameters:

Parameter
Type
Required
Description

transactionId

string

Required

ID returned upon submitting execution data

Response:

// Success:
{
    "transactionHash": "tx_00123456789",
    "status": "completed",
    "amount": 100.00,
    "currency": "USD",
    "recipientAccount": "1234567890",
    "description": "Payment for order #1234",
    "createdAt": "2024-11-17T12:00:00Z",
    "completedAt": "2024-11-17T12:05:00Z",
    "metadata": {
        "orderId": "1234",
        "customerNote": "Thanks for your service!"
    }
   
}

// Error:
{
  "errorCode": "TRANSACTION_NOT_FOUND",
  "message": "The transaction ID 'tx_00123456789' does not exist."
}

3. Querying Account Balance

POST /uxlink/account/v1/balance

Request Parameters:

Parameter
Type
Required
Description

accountId

string

Yes

The unique identifier of the account.

currency

string

No

The currency to query balance in (default to primary currency).

Request Body:

{
    "accountId": "1234567890",
    "currency": [], // ["USDT",""]
}

Response:

{
    data: [
        {
            "accountId": "1234567890",
            "balance": 5000.75,
            "currency": "USD",
            "lastUpdated": "2024-11-17T12:00:00Z"
        },
        {
            "accountId": "0987654321",
            "balance": 250.00,
            "currency": "USD",
            "lastUpdated": "2024-11-17T11:30:00Z"
        }
        ...
    ]
}

These adjustments provide a more professional and structured presentation of the API endpoints for developers working on the project.

Last updated