Skip to main content
TED Protocol provides a REST API for querying configuration, getting swap quotes, building transactions, and executing gasless relayed transactions.

Base URL

https://dev.talken.io/api/v1

Response Format

All responses follow a common wrapper structure:
{
  "success": true,
  "data": { ... }
}
On error:
{
  "success": false,
  "error": "Error message description"
}

Configuration

Endpoints for retrieving supported chains, DEXs, tokens, and contract addresses.

Get Chains

Returns the list of supported blockchain networks.
GET /config/chains
Parameters: None Response Fields:
FieldTypeDescription
chainKeystringUnique chain identifier (e.g. "ethereum", "arbitrum")
chainIdnumberEVM chain ID
namestringDisplay name
rpcUrlstringRPC endpoint URL
explorerUrlstringBlock explorer URL
nativeCurrencyobjectNative token info (name, symbol, decimals)
Example:
curl https://dev.talken.io/api/v1/config/chains
{
  "success": true,
  "data": [
    {
      "chainKey": "ethereum",
      "chainId": 1,
      "name": "Ethereum",
      "rpcUrl": "https://...",
      "explorerUrl": "https://etherscan.io",
      "nativeCurrency": {
        "name": "Ether",
        "symbol": "ETH",
        "decimals": 18
      }
    },
    {
      "chainKey": "arbitrum",
      "chainId": 42161,
      "name": "Arbitrum One",
      "rpcUrl": "https://...",
      "explorerUrl": "https://arbiscan.io",
      "nativeCurrency": {
        "name": "Ether",
        "symbol": "ETH",
        "decimals": 18
      }
    }
  ]
}

Get DEXs

Returns available DEXs for a specific chain.
GET /config/dexs/{chainKey}
Path Parameters:
ParameterTypeDescription
chainKeystringChain identifier (e.g. "ethereum", "arbitrum")
Response Fields:
FieldTypeDescription
dexKeystringUnique DEX identifier
namestringDisplay name
routerAddressstringDEX router contract address
typestringDEX type (e.g. "uniswap_v3", "curve")
Example:
curl https://dev.talken.io/api/v1/config/dexs/ethereum
{
  "success": true,
  "data": [
    {
      "dexKey": "uniswap_v3",
      "name": "Uniswap V3",
      "routerAddress": "0x...",
      "type": "uniswap_v3"
    },
    {
      "dexKey": "curve",
      "name": "Curve Finance",
      "routerAddress": "0x...",
      "type": "curve"
    }
  ]
}

Get Tokens

Returns supported tokens for a specific chain, including their capabilities (swap, bridge, etc.).
GET /config/tokens/{chainKey}
Path Parameters:
ParameterTypeDescription
chainKeystringChain identifier
Response Fields:
FieldTypeDescription
symbolstringToken symbol (e.g. "USDT", "USDC")
namestringToken full name
addressstringToken contract address
decimalsnumberToken decimals
capabilitiesstring[]Supported operations: "swap", "bridge_lz", "bridge_cctp"
Example:
curl https://dev.talken.io/api/v1/config/tokens/arbitrum
{
  "success": true,
  "data": [
    {
      "symbol": "USDT",
      "name": "Tether USD",
      "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
      "decimals": 6,
      "capabilities": ["swap", "bridge_lz"]
    },
    {
      "symbol": "USDC",
      "name": "USD Coin",
      "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "decimals": 6,
      "capabilities": ["swap", "bridge_cctp"]
    },
    {
      "symbol": "TEDP",
      "name": "TED Protocol",
      "address": "0x...",
      "decimals": 18,
      "capabilities": ["bridge_lz"]
    }
  ]
}

Get Contracts

Returns protocol contract addresses for a specific chain.
GET /config/contracts/{chainKey}
Path Parameters:
ParameterTypeDescription
chainKeystringChain identifier
Response Fields:
FieldTypeDescription
diamondstringMain Diamond proxy contract address
tedpstringTEDP token contract address
relayerstringGasless relayer contract address
Example:
curl https://dev.talken.io/api/v1/config/contracts/arbitrum
{
  "success": true,
  "data": {
    "diamond": "0x...",
    "tedp": "0x...",
    "relayer": "0x..."
  }
}

Quote

Get Quote

Returns a multi-path swap quote with optimal routing across available DEXs.
POST /quote
Request Body:
FieldTypeRequiredDescription
srcChainKeystringYesSource chain identifier
dstChainKeystringYesDestination chain identifier
tokenInstringYesInput token symbol or address
tokenOutstringYesOutput token symbol or address
amountInstringYesInput amount (in token’s smallest unit)
senderstringNoSender wallet address
recipientstringNoRecipient wallet address
Response Fields:
FieldTypeDescription
amountOutstringExpected output amount
routeobject[]Swap route steps
route[].dexstringDEX used for this step
route[].tokenInstringInput token for this step
route[].tokenOutstringOutput token for this step
route[].amountInstringInput amount for this step
route[].amountOutstringOutput amount for this step
priceImpactstringPrice impact in basis points
bridgeTypestringBridge type if cross-chain: "lz", "cctp", or null
estimatedGasstringEstimated gas cost
Example — Same-chain swap:
curl -X POST https://dev.talken.io/api/v1/quote \
  -H "Content-Type: application/json" \
  -d '{
    "srcChainKey": "arbitrum",
    "dstChainKey": "arbitrum",
    "tokenIn": "USDT",
    "tokenOut": "USDC",
    "amountIn": "1000000000"
  }'
{
  "success": true,
  "data": {
    "amountOut": "999500000",
    "route": [
      {
        "dex": "uniswap_v3",
        "tokenIn": "USDT",
        "tokenOut": "USDC",
        "amountIn": "1000000000",
        "amountOut": "999500000"
      }
    ],
    "priceImpact": "5",
    "bridgeType": null,
    "estimatedGas": "180000"
  }
}
Example — Cross-chain swap:
curl -X POST https://dev.talken.io/api/v1/quote \
  -H "Content-Type: application/json" \
  -d '{
    "srcChainKey": "ethereum",
    "dstChainKey": "arbitrum",
    "tokenIn": "USDT",
    "tokenOut": "USDC",
    "amountIn": "1000000000"
  }'
{
  "success": true,
  "data": {
    "amountOut": "998800000",
    "route": [
      {
        "dex": "uniswap_v3",
        "tokenIn": "USDT",
        "tokenOut": "USDC",
        "amountIn": "1000000000",
        "amountOut": "999500000"
      },
      {
        "dex": "bridge_cctp",
        "tokenIn": "USDC",
        "tokenOut": "USDC",
        "amountIn": "999500000",
        "amountOut": "998800000"
      }
    ],
    "priceImpact": "5",
    "bridgeType": "cctp",
    "estimatedGas": "350000"
  }
}

Transaction

Build Transaction

Builds a ready-to-sign transaction based on the selected action type. The action field determines the transaction type and required parameters.
POST /tx/build
Common Request Fields:
FieldTypeRequiredDescription
actionstringYesTransaction type (see below)
senderstringYesSender wallet address
srcChainKeystringYesSource chain identifier
Action Types:
ActionDescription
swapSingle-chain single-hop swap
swapMultiHopSingle-chain multi-hop swap
bridgeOnlyLzLayerZero bridge transfer (no swap)
bridgeOnlyCctpCCTP bridge transfer (no swap)
swapAndBridgeLzSwap then bridge via LayerZero
swapAndBridgeCctpSwap then bridge via CCTP
Additional Fields by Action: For swap and swapMultiHop:
FieldTypeRequiredDescription
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesInput amount
minAmountOutstringYesMinimum acceptable output
deadlinenumberYesUnix timestamp deadline
dexstringYesDEX identifier to use
For bridgeOnlyLz and bridgeOnlyCctp:
FieldTypeRequiredDescription
tokenstringYesToken address to bridge
amountstringYesAmount to bridge
dstChainKeystringYesDestination chain identifier
recipientstringYesRecipient address on destination chain
For swapAndBridgeLz and swapAndBridgeCctp:
FieldTypeRequiredDescription
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesInput amount
minAmountOutstringYesMinimum acceptable output
dstChainKeystringYesDestination chain identifier
recipientstringYesRecipient address
deadlinenumberYesUnix timestamp deadline
dexstringYesDEX identifier
Response Fields:
FieldTypeDescription
tostringTarget contract address
datastringEncoded calldata
valuestringNative token value to send (wei)
chainIdnumberChain ID for the transaction
gasLimitstringRecommended gas limit
Example — Single-chain swap:
curl -X POST https://dev.talken.io/api/v1/tx/build \
  -H "Content-Type: application/json" \
  -d '{
    "action": "swap",
    "sender": "0xYourAddress",
    "srcChainKey": "arbitrum",
    "tokenIn": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
    "tokenOut": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
    "amountIn": "1000000000",
    "minAmountOut": "995000000",
    "deadline": 1740000000,
    "dex": "uniswap_v3"
  }'
{
  "success": true,
  "data": {
    "to": "0xDiamondContractAddress",
    "data": "0x...",
    "value": "0",
    "chainId": 42161,
    "gasLimit": "250000"
  }
}
Example — Cross-chain swap and bridge:
const response = await fetch("https://dev.talken.io/api/v1/tx/build", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    action: "swapAndBridgeCctp",
    sender: walletAddress,
    srcChainKey: "ethereum",
    tokenIn: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    tokenOut: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    amountIn: "1000000000",
    minAmountOut: "995000000",
    dstChainKey: "arbitrum",
    recipient: walletAddress,
    deadline: Math.floor(Date.now() / 1000) + 3600,
    dex: "uniswap_v3"
  })
});

const { data: txData } = await response.json();

// Send the transaction with your wallet
const tx = await signer.sendTransaction({
  to: txData.to,
  data: txData.data,
  value: txData.value,
  gasLimit: txData.gasLimit
});

await tx.wait();

Relayer (Gasless)

Endpoints for gasless transaction execution. Users sign the transaction, and the relayer submits it on-chain, paying the gas fee.

Estimate Relayer Fee

Returns the estimated relayer fee for a gasless transaction.
POST /relayer/fee-estimate
Request Body:
FieldTypeRequiredDescription
chainKeystringYesChain where the transaction will execute
actionstringYesTransaction action type (same as /tx/build)
gasLimitstringNoEstimated gas limit (auto-estimated if omitted)
Response Fields:
FieldTypeDescription
feeTokenstringToken used for fee payment (e.g. "USDT")
feeAmountstringFee amount in fee token’s smallest unit
feeUsdstringFee in USD equivalent
gasPricestringCurrent gas price (wei)
validUntilnumberUnix timestamp until which this estimate is valid
Example:
curl -X POST https://dev.talken.io/api/v1/relayer/fee-estimate \
  -H "Content-Type: application/json" \
  -d '{
    "chainKey": "arbitrum",
    "action": "swap",
    "gasLimit": "250000"
  }'
{
  "success": true,
  "data": {
    "feeToken": "USDT",
    "feeAmount": "50000",
    "feeUsd": "0.05",
    "gasPrice": "100000000",
    "validUntil": 1740000600
  }
}

Execute Relay Transaction

Submits a signed transaction for gasless execution via the relayer.
POST /tx/relay-execute
Request Body:
FieldTypeRequiredDescription
chainKeystringYesChain identifier
signedTxobjectYesSigned transaction data
signedTx.tostringYesTarget contract address
signedTx.datastringYesEncoded calldata
signedTx.valuestringYesNative token value
signedTx.signaturestringYesEIP-712 typed data signature
strategystringYesRelay strategy: "sponsored" or "deducted"
feeTokenstringConditionalRequired if strategy is "deducted" — token for fee deduction
Strategy Types:
StrategyDescription
sponsoredGas fee is sponsored (free for the user)
deductedGas fee is deducted from the swap output in the specified fee token
Response Fields:
FieldTypeDescription
txHashstringOn-chain transaction hash
statusstring"submitted", "pending", "confirmed", or "failed"
blockNumbernumberBlock number (if confirmed)
gasUsedstringActual gas used (if confirmed)
feeDeductedstringFee deducted from output (if strategy is "deducted")
Example — Sponsored relay:
curl -X POST https://dev.talken.io/api/v1/tx/relay-execute \
  -H "Content-Type: application/json" \
  -d '{
    "chainKey": "arbitrum",
    "signedTx": {
      "to": "0xDiamondContractAddress",
      "data": "0x...",
      "value": "0",
      "signature": "0x..."
    },
    "strategy": "sponsored"
  }'
{
  "success": true,
  "data": {
    "txHash": "0xabc123...",
    "status": "confirmed",
    "blockNumber": 185000000,
    "gasUsed": "210000"
  }
}
Example — Fee-deducted relay (JavaScript):
// 1. Build the transaction
const buildRes = await fetch("https://dev.talken.io/api/v1/tx/build", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    action: "swap",
    sender: walletAddress,
    srcChainKey: "arbitrum",
    tokenIn: USDT_ADDRESS,
    tokenOut: USDC_ADDRESS,
    amountIn: "1000000000",
    minAmountOut: "995000000",
    deadline: Math.floor(Date.now() / 1000) + 600,
    dex: "uniswap_v3"
  })
});
const { data: txData } = await buildRes.json();

// 2. Sign with EIP-712
const signature = await signer.signTypedData(domain, types, txData);

// 3. Submit via relayer
const relayRes = await fetch("https://dev.talken.io/api/v1/tx/relay-execute", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    chainKey: "arbitrum",
    signedTx: {
      to: txData.to,
      data: txData.data,
      value: txData.value,
      signature: signature
    },
    strategy: "deducted",
    feeToken: "USDT"
  })
});

const { data: result } = await relayRes.json();
console.log("Tx hash:", result.txHash);

Error Handling

When a request fails, the response includes an error message:
{
  "success": false,
  "error": "Invalid token address"
}
Common Error Responses:
HTTP StatusErrorDescription
400"Invalid chain key"The specified chain is not supported
400"Invalid token address"Token address not found on the specified chain
400"Insufficient liquidity"Not enough liquidity for the requested swap
400"Amount too small"Input amount is below the minimum threshold
400"Invalid action"Unsupported action type for /tx/build
404"Route not found"No swap route available for the token pair
500"Internal server error"Server-side error — retry later
503"Service unavailable"API temporarily unavailable