Account Abstraction
API Reference
User Operation
Estimate User Operation
Transfer ERC1155 Token

Estimate ERC1155 Token Transfer Cost

Overview

This API endpoint allows you to estimate the cost of transferring ERC1155 tokens from an account.

  • HTTP Method: POST
  • Endpoint: {{BASE_URL}}/api/v1/userOp/sendERC1155/estimate

Request Body Parameters

  • accountId (required): The unique identifier of the account.
  • tokenAddress (required): The contract address of the ERC1155 token to transfer.
  • to (required): The recipient's wallet address.
  • tokenId (required): The ID of the token to transfer.
  • amount (required): The amount of tokens to transfer.
  • data (optional): Additional data to send with the transfer, in hexadecimal format.

Example Request Body

{
  "accountId": "67959f7927373a6808679de2",
  "tokenAddress": "0x....",
  "to": "0x....",
  "tokenId": "1",
  "amount": "20",
  "data": "0x"
}

Request

Request Headers

  • X-CLIENT-ID: (required): Client ID which was generated when registering in Xellar Account Abstraction API Service Dashboard.
  • X-SIGNATURE: (required): Calculated signature, please refer to Authorization section.
  • X-TIMESTAMP: (required): Request timestamp in RFC3339 format.

Example Request Syntax

curl -X POST -H "Content-Type: application/json" \
-H "x-client-id: $YOUR_CLIENT_ID" \
-H "x-signature: $CALCULATED_SIGNATURE" \
-H "x-timestamp: $TIMESTAMP" \
-d '{
    "accountId": "67959f7927373a6808679de2",
    "tokenAddress": "0x....",
    "to": "0x....",
    "tokenId": "1",
    "amount": "20",
    "data": "0x"
}' {{BASE_URL}}/api/v1/userOp/sendERC1155/estimate

Response

The response will include a JSON object with the following properties:

  • status (number): The HTTP status code of the response (e.g., 200 for success).
  • message (string): A message providing additional information about the operation.
  • data (object): An object containing the cost estimation details.
  • data.requiredETH (string): The estimated amount of ETH required.
  • data.requiredGasTankBalance (string): The estimated gas tank balance required.
  • data.decimal (number): The number of decimals used in the estimation.

Example Response

{
  "status": 200,
  "message": "success",
  "data": {
    "requiredETH": "8621402752060272",
    "requiredGasTankBalance": "31499329522982450044",
    "decimal": 18
  }
}