Relay API
How to communicate directly with the Gelato Relay API
Last updated
How to communicate directly with the Gelato Relay API
Last updated
Each relay request method possesses optional parameters such as the gasLimit
, and retries
.
/call-with-sync-fee/: for more information, please click here.
/call-with-sync-fee-erc2771/: for more information, please click here.
/sponsored-call/: for more information, please click here.
/sponsored-call-erc2771/: for more information, please click here.
If you'd like to use the debug endpoint with tenderly, you can make use of the debug endpoint and by adding the following parameters
tenderlyUsername
tenderlyProjectName
the request URL should look like this:
https://api.gelato.digital/tasks/status/{yourRelayTaskId}/debug?tenderlyUsername={yourUserName}&tenderlyProjectName={yourProjectName}
Everything will already be pre-set, all you need to do is click on "Simulate" and check what might have been the point of failure:
If the calldata is too big which may result in the following error upon clicking on the url returned by the api response:
The ID of the task to retrieve debug information for.
Username for Tenderly account.
Project name on Tenderly.
GET /tasks/status/{taskId}/debug HTTP/1.1
Host: api.gelato.digital
Accept: */*
{
"data": {
"to": "text",
"from": "text",
"calldata": "text",
"blockNumber": 1,
"gasLimit": 1,
"chainId": 1,
"taskId": "text"
},
"debugger": {
"tenderly": "text"
}
}
Id of the chain where the conversion rate is estimated
Token in which the conversion rate is estimated from the native token of the selected chain. If a value is not provided, it will default to the USDC address on the selected chain
GET /oracles HTTP/1.1
Host:
Accept: */*
{
"oracles": [
"text"
]
}
GET /oracles/{chainId}/paymentTokens HTTP/1.1
Host:
Accept: */*
{
"paymentTokens": [
"text"
]
}
GET /oracles/{chainId}/conversionRate HTTP/1.1
Host:
Accept: */*
{
"chainId": "text",
"from": "text",
"to": "text",
"conversionRate": 1,
"details": {
"numerator": "text",
"denominator": "text"
}
}
GET /relays/v2 HTTP/1.1
Host:
Accept: */*
{
"relays": [
"text"
]
}
Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsyncfee
POST /relays/v2/call-with-sync-fee HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 114
{
"chainId": 1,
"target": "text",
"data": "text",
"feeToken": "text",
"sponsorApiKey": "text",
"gasLimit": "text",
"retries": 1
}
{
"taskId": "text"
}
Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsyncfeeERC2771
POST /relays/v2/call-with-sync-fee-erc2771 HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 204
{
"chainId": 1,
"target": "text",
"data": "text",
"user": "text",
"userNonce": 1,
"userDeadline": 1,
"userSignature": "text",
"feeToken": "text",
"isRelayContext": true,
"sponsorApiKey": "text",
"gasLimit": "text",
"retries": 1
}
{
"taskId": "text"
}
Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsponsoredcall
POST /relays/v2/sponsored-call HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 96
{
"chainId": 1,
"target": "text",
"data": "text",
"sponsorApiKey": "text",
"gasLimit": "text",
"retries": 1
}
{
"taskId": "text"
}
Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsponsoreduserauthcall
POST /relays/v2/sponsored-call-erc2771 HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 164
{
"chainId": 1,
"target": "text",
"data": "text",
"user": "text",
"userNonce": 1,
"userDeadline": 1,
"userSignature": "text",
"sponsorApiKey": "text",
"gasLimit": "text",
"retries": 1
}
{
"taskId": "text"
}
GET /tasks/status/{taskId} HTTP/1.1
Host:
Accept: */*
{
"task": {
"chainId": 1,
"taskId": "text",
"taskState": "CheckPending",
"creationDate": "text",
"lastCheckDate": "text",
"lastCheckMessage": "text",
"transactionHash": "text",
"executionDate": "text",
"blockNumber": 1
}
}
Id of the chain where the fee is estimated
Payment Token
Gas limit
Priority | if high: true, otherwise: false
Gas limit for Layer 1 | For OP stack chains input BigInt(0)
GET /oracles/{chainId}/estimate?paymentToken=text&gasLimit=1&isHighPriority=true HTTP/1.1
Host:
Accept: */*
{
"estimatedFee": "text",
"decimals": 1
}