Query EOA gas abstraction fee records
curl --request GET \
--url https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction \
--header 'Authorization: Bearer <token>' \
--header 'X-Grid-Environment: <x-grid-environment>'import requests
url = "https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction"
headers = {
"X-Grid-Environment": "<x-grid-environment>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Grid-Environment': '<x-grid-environment>', Authorization: 'Bearer <token>'}
};
fetch('https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Grid-Environment: <x-grid-environment>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Grid-Environment", "<x-grid-environment>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction")
.header("X-Grid-Environment", "<x-grid-environment>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Grid-Environment"] = '<x-grid-environment>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"fees": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custom_identifier": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"confirmation_status": "<string>",
"tx_fee_lamports": "<string>",
"tx_fee_in_currency": "<string>",
"rent_fee_lamports": "<string>",
"rent_fee_in_currency": "<string>",
"price_per_sol": "<string>",
"signature": "<string>"
}
],
"pagination": {
"page": 123,
"limit": 123,
"total_count": 123,
"has_next_page": true
}
}{
"details": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"timestamp": "<string>"
}{
"details": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"timestamp": "<string>"
}{
"details": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"timestamp": "<string>"
}API Reference
Query Fee Records
Retrieve historical gas abstraction fee records with pagination and filtering
GET
/
transactions
/
eoa
/
gas-abstraction
Query EOA gas abstraction fee records
curl --request GET \
--url https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction \
--header 'Authorization: Bearer <token>' \
--header 'X-Grid-Environment: <x-grid-environment>'import requests
url = "https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction"
headers = {
"X-Grid-Environment": "<x-grid-environment>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Grid-Environment': '<x-grid-environment>', Authorization: 'Bearer <token>'}
};
fetch('https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Grid-Environment: <x-grid-environment>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Grid-Environment", "<x-grid-environment>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction")
.header("X-Grid-Environment", "<x-grid-environment>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Grid-Environment"] = '<x-grid-environment>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"fees": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custom_identifier": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"confirmation_status": "<string>",
"tx_fee_lamports": "<string>",
"tx_fee_in_currency": "<string>",
"rent_fee_lamports": "<string>",
"rent_fee_in_currency": "<string>",
"price_per_sol": "<string>",
"signature": "<string>"
}
],
"pagination": {
"page": 123,
"limit": 123,
"total_count": 123,
"has_next_page": true
}
}{
"details": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"timestamp": "<string>"
}{
"details": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"timestamp": "<string>"
}{
"details": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"timestamp": "<string>"
}The Query Gas Abstraction Fees endpoint provides access to historical fee records for transactions processed through the gas abstraction system for standard Solana wallets. Use this endpoint to track billing, analyze usage patterns, and monitor costs.
Solution: Ensure your custom identifier is a properly formatted UUID string.
Solution: Use ISO 8601 format for date parameters (e.g., “2024-01-01T00:00:00Z”).
Solution: Ensure
This endpoint retrieves only standard Solana wallet gas abstraction fee
records. For Squads smart accounts with built-in gas abstraction, see Grid’s
Smart Accounts.
Use Cases
This endpoint enables you to:- Track Billing History: Review all gas abstraction fees for accounting and reconciliation
- Filter by Identifier: Group and analyze transactions by custom identifier
- Analyze Usage Patterns: Understand fee trends over time
- Monitor Costs: Track spending across different features or users
- Audit Transactions: Verify fee records match your expectations
Usage Examples
Basic Query
Retrieve the first 50 fee records:const customIdentifier = "user-123-session-abc";
const response = await fetch(
`https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction?customIdentifier=${customIdentifier}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"X-Grid-Environment": "production",
},
}
);
const data = await response.json();
console.log(`Total records: ${data.data.pagination.total_count}`);
console.log(`Current page: ${data.data.fees.length} records`);
Paginated Retrieval
Fetch all fee records with pagination:async function getAllFeeRecords(customIdentifier) {
const allFees = [];
let page = 1;
const limit = 100;
while (true) {
const response = await fetch(
`https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction?customIdentifier=${customIdentifier}&page=${page}&limit=${limit}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"X-Grid-Environment": "production",
},
}
);
const data = await response.json();
allFees.push(...data.data.fees);
if (!data.data.pagination.has_next_page) break;
page++;
}
return allFees;
}
// Usage
const fees = await getAllFeeRecords("user-123-session-abc");
console.log(`Retrieved ${fees.length} total fee records`);
Date Range Filtering
Query fees within a specific time period:const customId = "user-123-session-abc";
const startDate = "2024-01-01T00:00:00Z";
const endDate = "2024-01-31T23:59:59Z";
const params = new URLSearchParams({
customIdentifier: customId,
startDate,
endDate,
limit: "100",
});
const response = await fetch(
`https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction?${params}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"X-Grid-Environment": "production",
},
}
);
const data = await response.json();
console.log(`January 2024: ${data.data.fees.length} transactions`);
Cost Analysis
Calculate total fees for a period:const customId = "user-123-session-abc";
const startDate = "2024-01-01T00:00:00Z";
const endDate = "2024-01-31T23:59:59Z";
const params = new URLSearchParams({
customIdentifier: customId,
startDate,
endDate,
});
const response = await fetch(
`https://grid.squads.xyz/api/v0/grid/transactions/eoa/gas-abstraction?${params}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"X-Grid-Environment": "production",
},
}
);
const data = await response.json();
// Calculate total costs
const totalCosts = data.data.fees.reduce((sum, fee) => {
const txFee = parseFloat(fee.tx_fee_in_currency || "0");
const rentFee = parseFloat(fee.rent_fee_in_currency || "0");
return sum + txFee + rentFee;
}, 0);
console.log(`Total fees for January 2024: $${totalCosts.toFixed(2)}`);
// Calculate average transaction fee
const avgFee = totalCosts / data.data.fees.length;
console.log(`Average fee per transaction: $${avgFee.toFixed(4)}`);
Pagination Information
Thepagination object provides navigation details:
- page: Current page number
- limit: Items per page
- total_count: Total number of records matching the query
- has_next_page: Whether additional pages are available
Response Headers
Pagination metadata is also available in response headers:X-Total-Count: Total number of recordsX-Page: Current page numberX-Limit: Current limit valueX-Next-Page: Next page number (if available)
Best Practices
Pagination Strategy
- Use appropriate page sizes: Start with 50-100 records per page
- Implement progressive loading: Fetch additional pages as needed
- Cache results: Store frequently accessed data to reduce API calls
- Handle pagination gracefully: Check
has_next_pagebefore fetching more
Performance Optimization
- Filter by date range: Narrow queries to specific time periods
- Use custom identifiers: Group related transactions for easier filtering
- Implement retry logic: Handle transient errors with exponential backoff
- Monitor rate limits: Space out requests to avoid throttling
Cost Monitoring
- Set up alerts: Monitor for unexpected fee spikes
- Regular audits: Review fee records periodically
- Budget tracking: Compare actual vs expected costs
- Usage analytics: Identify high-cost features or users
Data Retention
- Retention Period: Fee records are retained indefinitely for billing and audit purposes
- Historical Access: All records remain accessible from when you first started using the service
- Data Accuracy: Records reflect the exact fees charged at transaction time
Error Handling
Invalid Custom Identifier
{
"code": "INVALID_CUSTOM_IDENTIFIER",
"message": "Custom identifier must be a valid UUID"
}
Invalid Timestamp Format
{
"code": "INVALID_TIMESTAMP",
"message": "Timestamp must be in ISO 8601 format"
}
Invalid Pagination Parameters
{
"code": "INVALID_PAGINATION",
"message": "Limit must be between 1 and 1000"
}
limit is within the valid range (1-1000) and offset is non-negative.Authorizations
API Key for authentication
Headers
The environment you're using. Can be sandbox or production.
Query Parameters
Filter by custom identifier
Was this page helpful?