Skip to main content

POST /transaction/submit

Submit a cross-chain transaction with EIP-7702 authorization and intent execution.

Endpoint

POST /transaction/submit

Description

This endpoint allows you to submit transactions that will be executed across multiple chains. The system validates the transaction, saves it to the database, and returns tracking information. Execution is performed asynchronously by a solver.

Request Body

{
  address: Address;            // User wallet address
  authorization: [{
    chainId: number;
    address: string;
    nonce: number;
    r: string;
    s: string;
    yParity: number;
  }];
  intentAuthorization: {
    signature: string;
    chainBatches: Array<{
      hash: string;
      chainId: number | bigint;
      calls: Array<{ to: string; value: string | number | bigint; data: string }>;
      recentBlock?: number | bigint;
    }>;
  };
  tokenTransfers: Array<Array<{
    tokenAddress: Address;
    tokenAmount: bigint;
    sender?: Address;
    receiver?: Address;
  }>>;
}

Parameters

FieldTypeRequiredDescription
addressstringYesUser wallet address
authorizationarrayYesArray of EIP-7702 authorization objects
authorization[].chainIdnumberYesChain ID for the authorization
authorization[].addressstringYesAddress being authorized
authorization[].noncenumberYesAuthorization nonce
authorization[].rstringYesECDSA signature R value
authorization[].sstringYesECDSA signature S value
authorization[].yParitynumberYesECDSA signature Y parity
intentAuthorization.signaturestringYesIntent signature (becomes intent ID)
intentAuthorization.chainBatchesarrayYesArray of chain batches with calls
tokenTransfersarrayYes2D array of transfers per chain batch

Response

Success Response (200)

{
  "success": true,
  "data": {
    "status": "created",
    "intentId": "0xabcdef1234567890...",
    "transactionId": "uuid-generated-id"
  }
}

Response Fields

FieldTypeDescription
statusstringSubmission status (always created on success)
intentIdstringIntent identifier (same as intentAuthorization.signature)
transactionIdstringGenerated transaction ID for tracking

Error Responses

400 Bad Request

{
  "success": false,
  "error": {
    "message": "Missing authorization or intentAuthorization"
  }
}
{
  "success": false,
  "error": {
    "message": "Token transfers do not match calls"
  }
}
The API validates that tokenTransfers match the calls in each chain batch. Each transfer must correspond to the expected call data.

500 Internal Server Error

{
  "success": false,
  "error": {
    "message": "Internal server error"
  }
}

Example Request

curl -X POST /transaction/submit \
  -H "Content-Type: application/json" \
  -d '{
    "authorization": [
      {
        "chainId": 1,
        "address": "0x742d35Cc6634C0532925a3b8D8D428C83c76a4B",
        "nonce": 42,
        "r": "0x1234567890abcdef...",
        "s": "0xfedcba0987654321...",
        "yParity": 1
      },
      {
        "chainId": 137,
        "address": "0x742d35Cc6634C0532925a3b8D8D428C83c76a4B",
        "nonce": 43,
        "r": "0xabcdef1234567890...",
        "s": "0x0987654321fedcba...",
        "yParity": 0
      }
    ],
    "intentAuthorization": {
      "signature": "0xabcdef1234567890...",
      "chainBatches": [
        {
          "hash": "0x9876543210fedcba...",
          "chainId": 1,
          "calls": [
            {
              "to": "0x123...abc",
              "value": 0,
              "data": "0xa9059cbb..."
            }
          ],
          "recentBlock": 18500000
        }
      ]
    }
  }'

Workflow

  1. Transaction Validation: Validates authorization array and intentAuthorization are provided and properly formatted
  2. Database Storage: Saves the intent and all chain authorizations to the database for reliable tracking
  3. Chain Broadcast: Broadcasts the transaction to the appropriate blockchain network
  4. Response: Returns transaction hash and intent ID for subsequent step execution

Next Steps

After successful submission:
  1. Track Progress: Use the returned intentId to execute individual steps
  2. Execute Steps: Call POST /intent/{intentId}/execute/{stepId} for each step (0, 1, 2, …)
  3. Monitor Results: Each step execution returns detailed results and status

Example Workflow

# 1. Submit the intent with multiple authorizations
curl -X POST /transaction/submit -d '{
  "authorization": [
    {"chainId": 1, "address": "0x742...", "nonce": 42, ...},
    {"chainId": 137, "address": "0x742...", "nonce": 43, ...}
  ],
  "intentAuthorization": {...}
}'
# Returns: {"success": true, "data": {"transactionHash": "0x123...", "intentId": "0xabc..."}}

# 2. Execute step 0
curl -X POST /intent/0xabc.../execute/0 -d '{"executeOptions": {...}}'
# Returns: execution results for first chain authorization

# 3. Execute step 1
curl -X POST /intent/0xabc.../execute/1 -d '{"executeOptions": {...}}'
# Returns: execution results for second chain authorization

# Continue for all steps...

Notes

  • Intent ID is derived from intentAuthorization.signature
  • Authorization array can contain multiple EIP-7702 authorizations for different chains/addresses
  • All data is persisted to database for reliability and recovery
  • Step execution is triggered separately via the intent execution endpoint
  • Failed submissions can be debugged using the transaction hash
  • The system supports resumable execution for complex multi-step intents