Skip to content

Latest commit

 

History

History
256 lines (164 loc) · 9.62 KB

GasStationsApi.md

File metadata and controls

256 lines (164 loc) · 9.62 KB

GasStationsApi

All URIs are relative to https://developers.fireblocks.com/reference/

Method HTTP request Description
getGasStationByAssetId GET /gas_station/{assetId} Get gas station settings by asset
getGasStationInfo GET /gas_station Get gas station settings
updateGasStationConfiguration PUT /gas_station/configuration Edit gas station settings
updateGasStationConfigurationByAssetId PUT /gas_station/configuration/{assetId} Edit gas station settings for an asset

getGasStationByAssetId

GasStationPropertiesResponse getGasStationByAssetId()

Returns gas station settings and balances for a requested asset.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, GasStationsApiGetGasStationByAssetIdRequest, GasStationPropertiesResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: GasStationsApiGetGasStationByAssetIdRequest = {
  // string | The ID of the asset
  assetId: assetId_example,
};

fireblocks.gasStations.getGasStationByAssetId(body).then((res: FireblocksResponse<GasStationPropertiesResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
assetId [string] The ID of the asset defaults to undefined

Return type

GasStationPropertiesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Gas Station properties * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGasStationInfo

GasStationPropertiesResponse getGasStationInfo()

Returns gas station settings and ETH balance.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, GasStationPropertiesResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body:any = {};

fireblocks.gasStations.getGasStationInfo(body).then((res: FireblocksResponse<GasStationPropertiesResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

GasStationPropertiesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Gas Station properties * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateGasStationConfiguration

EditGasStationConfigurationResponse updateGasStationConfiguration(gasStationConfiguration)

Configures gas station settings for ETH.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, GasStationsApiUpdateGasStationConfigurationRequest, EditGasStationConfigurationResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: GasStationsApiUpdateGasStationConfigurationRequest = {
  // GasStationConfiguration
  gasStationConfiguration: param_value,
  // string | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional)
  idempotencyKey: idempotencyKey_example,
};

fireblocks.gasStations.updateGasStationConfiguration(body).then((res: FireblocksResponse<EditGasStationConfigurationResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
gasStationConfiguration GasStationConfiguration
idempotencyKey [string] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional) defaults to undefined

Return type

EditGasStationConfigurationResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 OK * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateGasStationConfigurationByAssetId

EditGasStationConfigurationResponse updateGasStationConfigurationByAssetId(gasStationConfiguration, )

Configures gas station settings for a requested asset.

Example

import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, GasStationsApiUpdateGasStationConfigurationByAssetIdRequest, EditGasStationConfigurationResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: GasStationsApiUpdateGasStationConfigurationByAssetIdRequest = {
  // GasStationConfiguration
  gasStationConfiguration: param_value,
  // string | The ID of the asset
  assetId: assetId_example,
  // string | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional)
  idempotencyKey: idempotencyKey_example,
};

fireblocks.gasStations.updateGasStationConfigurationByAssetId(body).then((res: FireblocksResponse<EditGasStationConfigurationResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
gasStationConfiguration GasStationConfiguration
assetId [string] The ID of the asset defaults to undefined
idempotencyKey [string] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional) defaults to undefined

Return type

EditGasStationConfigurationResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 OK * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]