Skip to main content

Authentication

All endpoints require the following headers unless otherwise noted:
Authorization
string
required
Bearer token (JWT) for end-user authentication. Format: Bearer YOUR_JWT_TOKEN
X-MAGIC-SECRET-KEY
string
required
Your Magic secret key for application-level authentication.

Get Quote

Get a LiFi quote for a cross-chain or same-chain token transfer.
cURL
curl -X GET 'https://uoa-server.magic.xyz/lifi/quote?from_chain=ETH&to_chain=ARB&from_token=USDC&to_token=USDC&from_amount=1000000' \
  -H 'Authorization: Bearer USER_JWT_TOKEN' \
  -H 'X-MAGIC-SECRET-KEY: YOUR_MAGIC_SECRET_KEY'
Response:
{
  "success": true,
  "data": {
    "action": { "fromChainId": 1, "toChainId": 42161 },
    "estimate": { "toAmount": "995000", "executionDuration": 120 },
    "transactionRequest": { "to": "0x...", "data": "0x...", "value": "0" },
    "tool": "stargate"
  }
}

Query Parameters

from_chain
string
required
Source chain. Values: ETH, ARB, POL, SOL, STRK, INK
to_chain
string
required
Destination chain. Values: ETH, ARB, POL, SOL, STRK, INK
from_token
string
required
Source token. Values: ETH, WETH, USDC, USDC.E, POL, SOL
to_token
string
required
Destination token. Values: ETH, WETH, USDC, USDC.E, POL, SOL
from_amount
string
required
Amount in smallest units (e.g., 1000000 for 1 USDC).
slippage
number
default:"0.005"
Slippage tolerance between 0 and 1 (e.g., 0.005 for 0.5%).
order
string
Route preference. Values: FASTEST, CHEAPEST

Execute Quote

Execute a LiFi quote by approving (if needed) and sending the transaction.
cURL
curl -X POST 'https://uoa-server.magic.xyz/lifi/execute' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer USER_JWT_TOKEN' \
  -H 'X-MAGIC-SECRET-KEY: YOUR_MAGIC_SECRET_KEY' \
  -d '{
    "quote": { "...full quote object from GET /lifi/quote..." }
  }'
Response:
{
  "success": true,
  "tx_hash": "0xabcdef1234567890..."
}

Request Parameters

quote
object
required
The full quote object returned from GET /lifi/quote.

Response Fields

success
boolean
Whether the transaction was submitted successfully.
tx_hash
string
The transaction hash on the source chain.

Check Transfer Status

Check the status of a LiFi cross-chain transfer.
cURL
curl -X GET 'https://uoa-server.magic.xyz/lifi/status?tx_hash=0xabc...&bridge=stargate&from_chain=ETH&to_chain=ARB'
Response:
{
  "success": true,
  "data": {
    "status": "DONE",
    "substatus": "COMPLETED",
    "substatusMessage": "Transfer completed successfully",
    "receiving": { "amount": "995000", "token": "USDC" },
    "sending": { "amount": "1000000", "token": "USDC" }
  }
}

Query Parameters

tx_hash
string
required
Transaction hash on the source chain.
bridge
string
required
Bridge tool key from the quote response (e.g., stargate).
from_chain
string
required
Source chain code.
to_chain
string
required
Destination chain code.
This endpoint does not require authentication.

Wait for Transfer

Poll LiFi status until the transfer completes or fails. This is a long-running endpoint.
cURL
curl -X GET 'https://uoa-server.magic.xyz/lifi/wait?tx_hash=0xabc...&bridge=stargate&from_chain=ETH&to_chain=ARB&timeout_sec=300'

Query Parameters

tx_hash
string
required
Transaction hash on the source chain.
bridge
string
required
Bridge tool key from the quote response.
from_chain
string
required
Source chain code.
to_chain
string
required
Destination chain code.
poll_interval_sec
integer
default:"15"
Polling interval in seconds. Range: 5—60.
timeout_sec
integer
default:"300"
Maximum wait time in seconds. Range: 30—600.
The response format is the same as Check Transfer Status.
This endpoint does not require authentication.

Alchemy Sponsored Transfer

Send a gas-sponsored transfer via Alchemy wallet APIs. Currently available on testnet chains only.
cURL
curl -X POST 'https://uoa-server.magic.xyz/alchemy/sponsored-transfer' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer USER_JWT_TOKEN' \
  -H 'X-MAGIC-SECRET-KEY: YOUR_MAGIC_SECRET_KEY' \
  -d '{
    "chain": "ARB",
    "network": "testnet",
    "token": "USDC",
    "amount": "10",
    "destination_address": "0xRecipient...",
    "fee_bps": 100
  }'
Response:
{
  "success": true,
  "user_operation_hash": "0x...",
  "chain": "ARB",
  "network": "testnet",
  "token": "USDC",
  "total_amount": "10",
  "transfer_amount": "9.90",
  "fee_amount": "0.10",
  "fee_bps": 100,
  "from_owner_address": "0x...",
  "transfer_to_address": "0xRecipient...",
  "fee_to_address": "0x...",
  "message": "Sponsored transfer completed"
}

Request Parameters

chain
string
required
The chain to execute on. Values: ETH, ARB, POL
network
string
default:"testnet"
Network type. Currently only testnet is supported. Values: mainnet, testnet
token
string
required
The token to transfer. Values: ETH, POL, USDC
amount
string
required
The total amount to send (transfer + fee) as a decimal string.
destination_address
string
required
The recipient wallet address.
fee_bps
integer
default:"100"
Fee in basis points deducted from the total amount. Range: 1—9999. (100 bps = 1%)
fee_recipient_address
string
Optional address to receive the fee. Defaults to a configured fee address.

Response Fields

success
boolean
Whether the sponsored transfer completed successfully.
user_operation_hash
string
The user operation hash for tracking.
total_amount
string
The total amount sent (transfer + fee).
transfer_amount
string
The amount received by the destination address.
fee_amount
string
The fee deducted from the total amount.
fee_bps
integer
The fee rate in basis points.
Sponsored transfers are currently only available on testnet (Sepolia, Amoy). Mainnet support is coming soon.