Skip to main content
PUT
/
tenant
/
{tenantId}
/
admin
/
gas_station
/
{walletTenantId}
/
update_wallet_gas_station
UpdateWalletGasStationConfiguration
curl --request PUT \
  --url https://api.example.com/tenant/{tenantId}/admin/gas_station/{walletTenantId}/update_wallet_gas_station \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Description

This endpoint updates the gas station configuration for a wallet tenant, including enabling/disabling gas station mode, setting auto-refuel parameters, and configuring custodian relationships. Gas station wallets automatically fund other wallets when their balance falls below specified thresholds.

Input

  • tenantId (path, required): Identifier of the tenant that owns the wallet
  • walletTenantId (path, required): Identifier of the wallet tenant to configure
  • request (body, required): Configuration payload containing gas station settings
    • isGasStation: Enable/disable gas station functionality
    • gasStationWalletCustodianId: Custodian managing the gas station wallet
    • autoRefuelIsEnabled: Enable/disable automatic refueling
    • autoRefuelMinimumBalance: Balance threshold that triggers auto-refuel
    • autoRefuelRefuelAmount: Amount to add during auto-refuel
    • autoRefuelSourceWalletTenantId: Source wallet for funding refuels
  • ct (optional): Token to cancel the asynchronous operation

Output

Returns a Result<WalletGasStationConfigurationClientModel> containing the updated configuration with current wallet balance, connected wallets count, and all gas station settings.

Examples

Request:
PUT /api/tenant/1024/gas-station/wallet/2048/configuration
Content-Type: application/json

{
  "id": 2048,
  "isGasStation": true,
  "gasStationWalletCustodianId": 7,
  "autoRefuelIsEnabled": true,
  "autoRefuelMinimumBalance": 0.1,
  "autoRefuelRefuelAmount": 0.5,
  "autoRefuelSourceWalletTenantId": 3001
}
Response (200 OK):
{
  "data": {
    "walletTenantId": 2048,
    "walletBalance": 0.85,
    "walletNetwork": "Ethereum Sepolia",
    "walletCoinName": "ETH",
    "walletAddress": "0xABCD...EF01",
    "walletName": "Operations Wallet",
    "isGasStation": true,
    "gasStationWalletCustodianId": 7,
    "autoRefuelIsEnabled": true,
    "autoRefuelMinimumBalance": 0.1,
    "autoRefuelRefuelAmount": 0.5,
    "connectedGasStationWalletsCount": 3
  },
  "isSuccess": true
}

Errors

  • 400 Bad Request: Invalid configuration parameters or validation failure
  • 401 Unauthorized: Authentication credentials are missing or invalid
  • 403 Forbidden: User lacks permission to modify wallet configurations
  • 404 Not Found: Tenant or wallet does not exist
  • 500 Internal Server Error: Unexpected server error occurred during update

Notes

  • Auto-refuel source wallet must have sufficient balance to fund refuels
  • Minimum balance and refuel amount must be positive values
  • Disabling gas station mode requires specifying replacement wallet if nested refuel chains exist

Path Parameters

tenantId
integer<int64>
required

Identifier of the tenant.

walletTenantId
integer<int64>
required

Identifier of the tenant wallet.

Query Parameters

api-version
string | null

Body

application/json

Request containing gas station configuration values.

Describes the configuration options for turning a wallet into a gas station or updating its refill behavior.

id
integer<int64>

Identifier of the wallet tenant being configured.

Example:

1001

isGasStation
boolean

Indicates whether the wallet functions as a gas station.

Example:

true

gasStationWalletCustodianId
integer<int64> | null

Identifier of the custodian managing the gas station wallet, when applicable.

Example:

7

autoRefuelIsEnabled
boolean

Indicates whether automatic refueling is enabled for this wallet.

Example:

true

autoRefuelMinimumBalance
number<decimal>

Minimum balance that triggers an automatic refuel.

Example:

0.25

autoRefuelRefuelAmount
number<decimal>

Amount of gas to add when an automatic refuel is executed.

Example:

1.5

autoRefuelSourceWalletTenantId
integer<int64> | null

Wallet tenant identifier to draw funds from during auto refuel operations.

Example:

2001

replaceAutoRefuelSourceWalletTenantId
integer<int64> | null

If gas station mode is disabled, represents the replacement wallet for nested auto refuel chains.

Example:

3001

Response

Wallet gas station configuration updated successfully.

Wrapper for API operation results containing success status, error information, and return value.

isSuccess
boolean

True if the operation completed successfully, false otherwise.

Example:

true

isFailure
boolean

True if the operation failed, false otherwise.

Example:

false

error
object

Error information returned when the operation fails.

Example:
{
"code": "ValidationError",
"message": "The request parameters failed validation.",
"info": [
"The Name field is required.",
"The Id field must be greater than 0."
]
}
value
object

The result value returned when the operation is successful.

Example:
{
"walletTenantId": 1001,
"walletBalance": 12.34,
"walletNetwork": "Ethereum Sepolia",
"walletCoinName": "ETH",
"walletNetworkIcon": "iVBORw0KGgoAAAANSUhEUgAAAAUA",
"walletAddress": "0xAbCDEF0123456789abcdef0123456789AbCdEf0",
"walletName": "Treasury Wallet",
"walletId": 501,
"blockchainId": 42,
"isGasStation": true,
"gasStationWalletCustodianId": 7,
"autoRefuelIsEnabled": true,
"autoRefuelSourceWalletTenantId": 2001,
"autoRefuelMinimumBalance": 0.25,
"autoRefuelRefuelAmount": 1.5,
"connectedGasStationWalletsCount": 3,
"connectedGasStationWalletsWithNestedCount": 5
}