Account Abstraction
API Reference
Account
Create Account

Create Account

Overview

This API endpoint allows you to create an account that represents a smart contract wallet. The created account will be in an inactive state (not deployed) and will need to be activated after funding the gas tank.

  • HTTP Method: POST
  • Endpoint: {{BASE_URL}}/api/v1/smart-account

Request Body Parameters

  • owner (required): An object containing the owner information
    • id (required): The owner's Ethereum address that will control the account
    • provider (required): The type of owner (currently only "wallet" is supported)

Example Request Body

{
  "owner": {
    "id": "0x10CB6162B0BF12Bf9b9fB899C617e71550dbAEB7",
    "provider": "wallet"
  }
}

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 '{
    "owner": {
        "id": "0x10CB6162B0BF12Bf9b9fB899C617e71550dbAEB7",
        "provider": "wallet"
    }
}' {{BASE_URL}}/api/v1/smart-account

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 indicating the result of the operation
  • data (object): An object containing the created account information
    • id (string): Unique identifier for the account
    • createdAt (string): Account creation timestamp
    • updatedAt (string|null): Last update timestamp
    • ownerId (string): The owner's address
    • provider (string): The account provider type
    • clientId (string): Your client ID
    • gasTanks (array): List of gas tanks associated with the account
    • accounts (array): List of created accounts for different networks

Example Response

{
  "status": 200,
  "message": "account created successfully",
  "data": {
    "id": "67bd5c5794c725bc73eb88b6",
    "createdAt": "2025-02-25T12:59:51.29611+07:00",
    "updatedAt": null,
    "ownerId": "0x10CB6162B0BF12Bf9b9fB899C617e71550dbAEB7",
    "provider": "wallet",
    "clientId": "19eb9738-dc52-493a-a602-b4d08f946bba",
    "gasTanks": [
      {
        "id": "67bd5c5794c725bc73eb88b7",
        "createdAt": "2025-02-25T12:59:51.302684+07:00",
        "updatedAt": null,
        "ownerId": "67bd5c5794c725bc73eb88b6",
        "balance": "0",
        "type": "token",
        "tokenName": "USDT",
        "decimals": 18
      }
    ],
    "accounts": [
      {
        "id": "67bd5c5794c725bc73eb88b8",
        "createdAt": "2025-02-25T12:59:51.307212+07:00",
        "updatedAt": null,
        "ownerId": "67bd5c5794c725bc73eb88b6",
        "status": "not_deployed",
        "aaAddress": "0x7E3A124E509051C5019C51e1893deFa3D2598623",
        "chainId": 11155111,
        "network": "ethereum-sepolia",
        "clientId": "19eb9738-dc52-493a-a602-b4d08f946bba",
        "version": "0.1"
      }
      // ... other network accounts
    ]
  }
}

Important Notes

  1. The created account will be in not_deployed status initially
  2. Accounts are automatically created for all supported networks
  3. Each account needs to be activated separately after funding the gas tank
  4. The aaAddress is the future smart contract wallet address that will be deployed during activation
  5. This endpoint is idempotent - if an account already exists for the given owner address, the existing account details will be returned instead of creating a new one. This makes it safe to retry the request without creating duplicate accounts.