Get Individual Gas Tank Usage History
Overview
This API endpoint allows you to retrieve the gas tank usage history for a specific smart account owner. It provides details of each usage transaction, including amounts and rates.
- HTTP Method: GET
- Endpoint:
{{BASE_URL}}/api/v1/smart-account/:ownerId/gasTank/history
Request Parameters
ownerId
(required): The unique identifier of the smart account owner whose gas tank usage history is being requested.
Request Headers
X-CLIENT-ID
: (required): Client ID which was generated when registering in Xellar Account Abstraction API Service Dashboard.X-SIGNATURE
: (required): Calculated signature, please refer to Authorization section.X-TIMESTAMP
: (required): Request timestamp in RFC3339 format.
Example Request Syntax
curl -X GET -H "Content-Type: application/json" \
-H "x-client-id: $YOUR_CLIENT_ID" \
-H "x-signature: $CALCULATED_SIGNATURE" \
-H "x-timestamp: $TIMESTAMP" \
"{{BASE_URL}}/api/v1/smart-account/:ownerId/gasTank/history"
Response
The response will include a JSON object with the following properties:
status
(number): The HTTP status code of the response (e.g., 200 for success).message
(string): A message indicating the result of the request.data
(array): An array of objects, each representing a gas tank usage transaction with the following properties:id
(string): The unique identifier of the usage transaction.accountId
(string): The account ID associated with the transaction.ownerId
(string): The owner ID of the smart account.userOpId
(string): The user operation ID related to the transaction.gasTankId
(string): The gas tank ID used in the transaction.nativeToGasTankRate
(number): The conversion rate from native currency to gas tank currency.amountInNative
(string): The amount in native currency.amountInGasTank
(string): The amount in gas tank currency.initialDeductedAmountInNative
(string): The initially deducted amount in native currency.initialDeductedAmountInGasTank
(string): The initially deducted amount in gas tank currency.refundedAmountInNative
(string|null): The refunded amount in native currency, if any.refundedAmountInGasTank
(string|null): The refunded amount in gas tank currency, if any.createdAt
(string): The timestamp when the transaction was created.refundedAt
(string|null): The timestamp when the refund was processed, if applicable.
Example Response
{
"status": 200,
"message": "success get gas tank usage history",
"data": [
{
"id": "67b1fcda442f26832dadd882",
"accountId": "67b1f9310521667c3e94d625",
"ownerId": "67b1f9310521667c3e94d623",
"userOpId": "67b1fc9a442f26832dadd881",
"gasTankId": "67b1f9310521667c3e94d624",
"nativeToGasTankRate": 2687.91,
"amountInNative": "6112687393512777",
"amountInGasTank": "16430353571896927537",
"initialDeductedAmountInNative": "6112687393512777",
"initialDeductedAmountInGasTank": "16430353571896927537",
"refundedAmountInNative": null,
"refundedAmountInGasTank": null,
"createdAt": "2025-02-16T14:57:29.983Z",
"refundedAt": null
}
]
}