Execute Gasless Txs - Relay

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

cURL

curl --request POST \
  --url https://api.relay.link/execute \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "executionKind": "rawCalls",
  "data": {
    "chainId": 123,
    "to": "<string>",
    "data": "<string>",
    "value": "<string>",
    "authorizationList": [
      {
        "chainId": 123,
        "address": "<string>",
        "nonce": 123,
        "yParity": 123,
        "r": "<string>",
        "s": "<string>"
      }
    ]
  },
  "executionOptions": {
    "referrer": "<string>",
    "subsidizeFees": true
  }
}
'
const options = {
  method: 'POST',
  headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    executionKind: 'rawCalls',
    data: {
      chainId: 123,
      to: '<string>',
      data: '<string>',
      value: '<string>',
      authorizationList: [
        {
          chainId: 123,
          address: '<string>',
          nonce: 123,
          yParity: 123,
          r: '<string>',
          s: '<string>'
        }
      ]
    },
    executionOptions: {referrer: '<string>', subsidizeFees: true}
  })
};

fetch('https://api.relay.link/execute', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.relay.link/execute"

payload = {
    "executionKind": "rawCalls",
    "data": {
        "chainId": 123,
        "to": "<string>",
        "data": "<string>",
        "value": "<string>",
        "authorizationList": [
            {
                "chainId": 123,
                "address": "<string>",
                "nonce": 123,
                "yParity": 123,
                "r": "<string>",
                "s": "<string>"
            }
        ]
    },
    "executionOptions": {
        "referrer": "<string>",
        "subsidizeFees": True
    }
}
headers = {
    "x-api-key": "<x-api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Response Codes

Sample Responses

{
  "message": "Transaction submitted",
  "requestId": "0xabc123..."
}
{
  "error": "to is required"
}
{
  "error": "Unauthorized"
}
{
  "error": "Internal server error"
}

Headers

Body