Estimates fees for a sponsored (gasless) transaction.

Outdated Version

You're viewing an older version (v1.5.x). The latest documentation is available for the current version. Click here to visit latest version.

This endpoint provides fee estimation for transactions where the relayer will pay the network fees on behalf of the user. The user pays fees in a token of their choice (e.g., USDC) instead of the native network currency (e.g., XLM for Stellar).

The endpoint accepts either a pre-built transaction XDR or a set of operations to build a transaction from. It returns the estimated fee amount in the specified fee token and the conversion rate from the native currency.

POST
/api/v1/relayers/{relayer_id}/transactions/sponsored/quote
AuthorizationBearer <token>

In: header

Path Parameters

relayer_idstring

The unique identifier of the relayer

Solana-specific fee estimate request parameters

fee_tokenstring
transactionEncodedSerializedTransaction

Stellar-specific fee estimate request parameters (classic and Soroban)

fee_tokenstring

Asset identifier for fee token. For classic: "native" or "USDC:GA5Z..." format. For Soroban: contract address (C...) format.

operations?array<OperationSpec> | null

Operations array to build transaction from Mutually exclusive with transaction_xdr field

source_account?string | null

Source account address (required when operations are provided) For sponsored transactions, this should be the user's account address

transaction_xdr?string | null

Pre-built transaction XDR (base64 encoded, signed or unsigned) Mutually exclusive with operations field. For Soroban gas abstraction: pass XDR containing InvokeHostFunction operation.

Response Body

curl -X POST "https://loading/api/v1/relayers/string/transactions/sponsored/quote" \  -H "Content-Type: application/json" \  -d '{    "fee_token": "string",    "transaction": "string"  }'
{
  "data": {
    "conversion_rate": "0.15",
    "estimated_fee": "1.5"
  },
  "message": "Fee estimate retrieved successfully",
  "success": true
}
{
  "data": null,
  "message": "Bad Request",
  "success": false
}
{
  "data": null,
  "message": "Unauthorized",
  "success": false
}
{
  "data": null,
  "message": "Relayer with ID relayer_id not found",
  "success": false
}
{
  "data": null,
  "message": "Too Many Requests",
  "success": false
}
{
  "data": null,
  "message": "Internal Server Error",
  "success": false
}