Account Abstraction
SDK
Gas Tank
Top Up

Top Up Gas Tank

Overview

This SDK method allows you to top up account individual gas tank using a specified token. The top-up can be processed immediately or scheduled for a short delay to account for mining times.

Method

xellar.sdk.gasTank.topUp({
  txHash: string,
  chainId: number,
  receiverOwnerId: string,
  tokenAddress: string,
  poolAddress: string,
  immediate: boolean,
  signature: string,
});

Parameters

  • txHash (required): The transaction hash of the top-up.
  • chainId (required): The chain ID where the transaction is executed.
  • receiverOwnerId (required): The owner ID of the receiver account.
  • tokenAddress (required): The address of the token used for the top-up. Must be the USDT address.
  • poolAddress (required): The address of the Xellar pool. Refer to the Pool Section for details.
  • immediate (required): A boolean indicating whether the top-up should be processed immediately. If true, the top-up is checked immediately; if false, it is checked approximately 20 seconds later to compensate for mining delay.
  • signature (required): A signature of the format ${chainId}.${txHash} signed by the wallet that initiated the transfer.

Example Request

const response = await xellar.sdk.gasTank.topUp({
  txHash: "0x....",
  chainId: 137,
  receiverOwnerId: "67959f7927373a6808679ddf",
  tokenAddress: "0x...",
  poolAddress: "0x...",
  immediate: true,
  signature: "0x.....",
});

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 top-up operation.

Example Response

{
  "status": 200,
  "message": "success topup"
}