Skip to main content
POST
/
v1
/
sponsor
Sponsor Transaction
curl --request POST \
  --url https://api.example.com/v1/sponsor \
  --header 'Content-Type: application/json' \
  --data '
{
  "transaction": "<string>",
  "network": "<string>"
}
'
{
  "hash": "<string>",
  "feePaid": "<string>",
  "ledger": 123,
  "resultXdr": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://grat.mintlify.app/llms.txt

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

Wraps the provided transaction XDR in a fee-bump envelope and submits it to the Stellar network.

Request Body

transaction
string
required
The base64-encoded XDR of the signed transaction or fee-bump transaction to sponsor.
network
string
required
The target network. Must be either testnet or mainnet.

Response Fields

hash
string
The transaction hash generated by the Stellar network.
feePaid
string
The total network fee paid by the relay in stroops.
ledger
number
The sequence number of the ledger that included the transaction.
resultXdr
string
The base64-encoded result XDR returned by the network.

Error Codes

CodeDescription
VALIDATION_ERRORThe provided XDR is malformed or invalid.
INSUFFICIENT_CREDITSYour project balance is too low to cover the fee.
SUBMISSION_FAILEDThe network rejected the transaction (e.g., tx_bad_seq).
RATE_LIMIT_EXCEEDEDYou have exceeded your project’s rate limit.

SDK Example

import { Grat } from '@grat-official-sdk/sdk';
const grat = Grat.testnet();

const result = await grat.sponsor(transaction);
console.log(result.hash);
View on GitHub