/swap

POSThttps://api.aori.io

Submit a signed swap order for execution on the Aori protocol. This endpoint accepts a signed order hash and initiates the cross-chain swap process.

Request

  • Name
    orderHash
    Type
    string
    Description

    The unique identifier of the order to execute (from quote response)

  • Name
    signature
    Type
    string
    Description

    The cryptographic signature authorizing the swap

cURL

curl -X POST https://api.aori.io/swap \
  -H "Content-Type: application/json" \
  -d '{
    "orderHash": "0x1234567890abcdef1234567890abcdef12345678",
    "signature": "0x1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01"
  }'

Response

  • Name
    orderHash
    Type
    string
    Description

    Unique identifier for the order

  • Name
    offerer
    Type
    string
    Description

    The address that initiated the swap

  • Name
    recipient
    Type
    string
    Description

    The address receiving the output tokens

  • Name
    inputToken
    Type
    string
    Description

    The token contract address being sold

  • Name
    outputToken
    Type
    string
    Description

    The token contract address being bought

  • Name
    inputAmount
    Type
    string
    Description

    The amount of input tokens (in wei/smallest unit)

  • Name
    outputAmount
    Type
    string
    Description

    The amount of output tokens (in wei/smallest unit)

  • Name
    inputChain
    Type
    string
    Description

    The source chain identifier

  • Name
    outputChain
    Type
    string
    Description

    The destination chain identifier

  • Name
    startTime
    Type
    number
    Description

    Unix timestamp when the order became valid

  • Name
    endTime
    Type
    number
    Description

    Unix timestamp when the order expires

  • Name
    status
    Type
    string
    Description

    Current status of the swap (pending, received, completed, failed)

  • Name
    createdAt
    Type
    number
    Description

    Unix timestamp when the swap was created

Response

{
  "orderHash": "0x1234567890abcdef1234567890abcdef12345678",
  "offerer": "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b",
  "recipient": "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b",
  "inputToken": "0x4200000000000000000000000000000000000006",
  "outputToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
  "inputAmount": "1000000000000000000",
  "outputAmount": "3200000000",
  "inputChain": "base",
  "outputChain": "arbitrum",
  "startTime": 1703001600,
  "endTime": 1703005200,
  "status": "pending",
  "createdAt": 1703001600
}